From 5054c83e90e0ad664a35018cf2feac40a56704e1 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Thu, 6 Feb 2020 15:42:28 -0500 Subject: [PATCH] convo10_30 updated and verified --- .../convertors/conv10_30/Account10_30.java | 19 +- .../conv10_30/Appointment10_30.java | 55 +- .../conv10_30/AppointmentResponse10_30.java | 31 +- .../convertors/conv10_30/AuditEvent10_30.java | 112 ++-- .../fhir/convertors/conv10_30/Basic10_30.java | 11 +- .../convertors/conv10_30/Binary10_30.java | 20 +- .../convertors/conv10_30/Bundle10_30.java | 137 ++--- .../convertors/conv10_30/CarePlan10_30.java | 30 +- .../conv10_30/ClinicalImpression10_30.java | 39 +- .../conv10_30/Communication10_30.java | 21 +- .../conv10_30/CommunicationRequest10_30.java | 10 +- .../conv10_30/Composition10_30.java | 39 +- .../convertors/conv10_30/ConceptMap10_30.java | 132 ++--- .../convertors/conv10_30/Condition10_30.java | 6 +- .../conv10_30/Conformance10_30.java | 288 +++++---- .../convertors/conv10_30/Contract10_30.java | 84 ++- .../conv10_30/DataElement10_30.java | 113 ++-- .../conv10_30/DetectedIssue10_30.java | 37 +- .../convertors/conv10_30/Device10_30.java | 70 +-- .../conv10_30/DeviceComponent10_30.java | 21 +- .../conv10_30/DeviceMetric10_30.java | 11 +- .../conv10_30/DeviceUseStatement10_30.java | 11 +- .../conv10_30/DiagnosticReport10_30.java | 31 +- .../conv10_30/DocumentManifest10_30.java | 31 +- .../conv10_30/DocumentReference10_30.java | 31 +- .../convertors/conv10_30/Encounter10_30.java | 1 + .../conv10_30/EnrollmentRequest10_30.java | 11 +- .../conv10_30/EnrollmentResponse10_30.java | 21 +- .../conv10_30/EpisodeOfCare10_30.java | 1 + .../conv10_30/FamilyMemberHistory10_30.java | 19 +- .../fhir/convertors/conv10_30/Flag10_30.java | 1 + .../fhir/convertors/conv10_30/Group10_30.java | 45 +- .../conv10_30/HealthcareService10_30.java | 88 ++- .../conv10_30/ImagingStudy10_30.java | 116 ++-- .../conv10_30/Immunization10_30.java | 74 ++- .../ImmunizationRecommendation10_30.java | 48 +- .../conv10_30/ImplementationGuide10_30.java | 193 +++--- .../fhir/convertors/conv10_30/List10_30.java | 27 +- .../convertors/conv10_30/Location10_30.java | 46 +- .../fhir/convertors/conv10_30/Media10_30.java | 35 +- .../convertors/conv10_30/Medication10_30.java | 10 +- .../conv10_30/MedicationDispense10_30.java | 25 +- .../conv10_30/MedicationStatement10_30.java | 22 +- .../conv10_30/MessageHeader10_30.java | 81 ++- .../conv10_30/NamingSystem10_30.java | 88 ++- .../conv10_30/Observation10_30.java | 30 +- .../conv10_30/OperationDefinition10_30.java | 168 +++--- .../conv10_30/OperationOutcome10_30.java | 11 +- .../conv10_30/Organization10_30.java | 20 +- .../convertors/conv10_30/Parameters10_30.java | 11 +- .../convertors/conv10_30/Patient10_30.java | 20 +- .../convertors/conv10_30/Person10_30.java | 20 +- .../conv10_30/Practitioner10_30.java | 20 +- .../convertors/conv10_30/Procedure10_30.java | 10 +- .../conv10_30/ProcedureRequest10_30.java | 1 + .../convertors/conv10_30/Provenance10_30.java | 11 +- .../conv10_30/Questionnaire10_30.java | 99 ++-- .../conv10_30/QuestionnaireResponse10_30.java | 51 +- .../conv10_30/ReferralRequest10_30.java | 11 +- .../conv10_30/RelatedPerson10_30.java | 11 +- .../conv10_30/RiskAssessment10_30.java | 30 +- .../convertors/conv10_30/Schedule10_30.java | 11 +- .../conv10_30/SearchParameter10_30.java | 103 ++-- .../fhir/convertors/conv10_30/Slot10_30.java | 40 +- .../convertors/conv10_30/Specimen10_30.java | 13 +- .../conv10_30/StructureDefinition10_30.java | 167 +++--- .../conv10_30/Subscription10_30.java | 66 +-- .../convertors/conv10_30/Substance10_30.java | 21 +- .../conv10_30/SupplyDelivery10_30.java | 1 + .../conv10_30/SupplyRequest10_30.java | 1 + .../convertors/conv10_30/TestScript10_30.java | 456 ++++++-------- .../convertors/conv10_30/ValueSet10_30.java | 309 +++++----- .../hl7/fhir/convertors/parser/Parser.java | 558 +++++++++--------- 73 files changed, 2077 insertions(+), 2535 deletions(-) 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 6d6707391..89676e3e0 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 @@ -13,9 +13,8 @@ public class Account10_30 { 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.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasType()) { tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); } @@ -34,9 +33,8 @@ public class Account10_30 { if (src.hasOwner()) { tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); return tgt; } @@ -48,8 +46,8 @@ public class Account10_30 { 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.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasType()) tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); if (src.hasStatus()) { @@ -67,9 +65,8 @@ public class Account10_30 { if (src.hasOwner()) { tgt.setOwner(VersionConvertor_10_30.convertReference(src.getOwner())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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 e957f51c1..4168d6cf0 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 @@ -1,7 +1,10 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.PositiveIntType; +import org.hl7.fhir.dstu2.model.UnsignedIntType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Appointment10_30 { @@ -19,27 +22,23 @@ public class Appointment10_30 { 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.hasPriorityElement()) { + tgt.setPriorityElement((UnsignedIntType) VersionConvertor_10_30.convertType(src.getPriorityElement())); } - 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasStartElement()) + tgt.setStartElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getStartElement())); + if (src.hasEndElement()) + tgt.setEndElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getEndElement())); + if (src.hasMinutesDurationElement()) { + tgt.setMinutesDurationElement((PositiveIntType) VersionConvertor_10_30.convertType(src.getMinutesDurationElement())); } 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.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); if (src.hasParticipant()) { for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); } @@ -62,24 +61,20 @@ public class Appointment10_30 { 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasStartElement()) + tgt.setStartElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getStartElement())); + if (src.hasEndElement()) + tgt.setEndElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getEndElement())); + if (src.hasMinutesDurationElement()) { + tgt.setMinutesDurationElement((org.hl7.fhir.dstu3.model.PositiveIntType) VersionConvertor_10_30.convertType(src.getMinutesDurationElement())); } 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.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); if (src.hasParticipant()) { for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t)); } 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 b5eaaee0c..092e82652 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class AppointmentResponse10_30 { @@ -16,12 +17,10 @@ public class AppointmentResponse10_30 { 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.hasStartElement()) + tgt.setStartElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getStartElement())); + if (src.hasEndElement()) + tgt.setEndElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getEndElement())); if (src.hasParticipantType()) { for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_30.convertCodeableConcept(t)); } @@ -31,9 +30,8 @@ public class AppointmentResponse10_30 { if (src.hasParticipantStatus()) { tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); } - if (src.hasComment()) { - tgt.setComment(src.getComment()); - } + if (src.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); return tgt; } @@ -48,12 +46,10 @@ public class AppointmentResponse10_30 { 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.hasStartElement()) + tgt.setStartElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getStartElement())); + if (src.hasEndElement()) + tgt.setEndElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getEndElement())); if (src.hasParticipantType()) { for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(VersionConvertor_10_30.convertCodeableConcept(t)); } @@ -63,9 +59,8 @@ public class AppointmentResponse10_30 { if (src.hasParticipantStatus()) { tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus())); } - if (src.hasComment()) { - tgt.setComment(src.getComment()); - } + if (src.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); 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 f4ef2ef09..0a6a52937 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 @@ -1,7 +1,13 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.Base64BinaryType; +import org.hl7.fhir.dstu2.model.InstantType; +import org.hl7.fhir.dstu2.model.StringType; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; +import java.util.stream.Collectors; public class AuditEvent10_30 { @@ -19,14 +25,14 @@ public class AuditEvent10_30 { if (src.hasAction()) { tgt.getEvent().setAction(convertAuditEventAction(src.getAction())); } - if (src.hasRecorded()) { - tgt.getEvent().setDateTime(src.getRecorded()); + if (src.hasRecordedElement()) { + tgt.getEvent().setDateTimeElement((InstantType) VersionConvertor_10_30.convertType(src.getRecordedElement())); } if (src.hasOutcome()) { tgt.getEvent().setOutcome(convertAuditEventOutcome(src.getOutcome())); } - if (src.hasOutcomeDesc()) { - tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc()); + if (src.hasOutcomeDescElement()) { + tgt.getEvent().setOutcomeDescElement((StringType) VersionConvertor_10_30.convertType(src.getOutcomeDescElement())); } 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)); @@ -59,13 +65,13 @@ public class AuditEvent10_30 { tgt.setAction(convertAuditEventAction(src.getEvent().getAction())); } if (src.hasEvent()) { - tgt.setRecorded(src.getEvent().getDateTime()); + tgt.setRecordedElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getEvent().getDateTimeElement())); } if (src.hasEvent()) { tgt.setOutcome(convertAuditEventOutcome(src.getEvent().getOutcome())); } if (src.hasEvent()) { - tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc()); + tgt.setOutcomeDescElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getEvent().getOutcomeDescElement())); } if (src.hasEvent()) { for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent()) tgt.addPurposeOfEvent().addCoding(VersionConvertor_10_30.convertCoding(t)); @@ -135,20 +141,20 @@ public class AuditEvent10_30 { 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.hasAltIdElement()) + tgt.setAltIdElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getAltIdElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasRequestorElement()) { + tgt.setRequestorElement((BooleanType) VersionConvertor_10_30.convertType(src.getRequestorElement())); } 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()); + tgt.setPolicy(src.getPolicy().stream() + .map(policy -> (org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(policy)) + .collect(Collectors.toList())); } if (src.hasMedia()) { tgt.setMedia(VersionConvertor_10_30.convertCoding(src.getMedia())); @@ -176,14 +182,12 @@ public class AuditEvent10_30 { 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.hasAltIdElement()) + tgt.setAltIdElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getAltIdElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasRequestorElement()) { + tgt.setRequestorElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getRequestorElement())); } if (src.hasLocation()) { tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); @@ -208,9 +212,8 @@ 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); - if (src.hasAddress()) { - tgt.setAddress(src.getAddress()); - } + if (src.hasAddressElement()) + tgt.setAddressElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getAddressElement())); if (src.hasType()) { tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); } @@ -222,9 +225,8 @@ 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); - if (src.hasAddress()) { - tgt.setAddress(src.getAddress()); - } + if (src.hasAddressElement()) + tgt.setAddressElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getAddressElement())); if (src.hasType()) { tgt.setType(convertAuditEventParticipantNetworkType(src.getType())); } @@ -254,12 +256,10 @@ public class AuditEvent10_30 { 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.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasQuery()) { tgt.setQuery(src.getQuery()); } @@ -292,14 +292,12 @@ public class AuditEvent10_30 { 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.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasQueryElement()) { + tgt.setQueryElement((Base64BinaryType) VersionConvertor_10_30.convertType(src.getQueryElement())); } if (src.hasDetail()) { for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t)); @@ -312,11 +310,10 @@ 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); - if (src.hasType()) { - tgt.setType(src.getType()); - } - if (src.hasValue()) { - tgt.setValue(src.getValue()); + if (src.hasTypeElement()) + tgt.setTypeElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTypeElement())); + if (src.hasValueElement()) { + tgt.setValueElement((Base64BinaryType) VersionConvertor_10_30.convertType(src.getValueElement())); } return tgt; } @@ -326,11 +323,10 @@ 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); - if (src.hasType()) { - tgt.setType(src.getType()); - } - if (src.hasValue()) { - tgt.setValue(src.getValue()); + if (src.hasTypeElement()) + tgt.setTypeElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTypeElement())); + if (src.hasValueElement()) { + tgt.setValueElement((org.hl7.fhir.dstu3.model.Base64BinaryType) VersionConvertor_10_30.convertType(src.getValueElement())); } return tgt; } @@ -412,9 +408,8 @@ 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); - if (src.hasSite()) { - tgt.setSite(src.getSite()); - } + if (src.hasSiteElement()) + tgt.setSiteElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getSiteElement())); if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } @@ -429,9 +424,8 @@ 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); - if (src.hasSite()) { - tgt.setSite(src.getSite()); - } + if (src.hasSiteElement()) + tgt.setSiteElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getSiteElement())); if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } 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 58035aeb6..73cd38b86 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Basic10_30 { @@ -19,9 +20,8 @@ public class Basic10_30 { if (src.hasSubject()) { tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); } - if (src.hasCreated()) { - tgt.setCreated(src.getCreated()); - } + if (src.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu2.model.DateType) VersionConvertor_10_30.convertType(src.getCreatedElement())); if (src.hasAuthor()) { tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); } @@ -42,9 +42,8 @@ public class Basic10_30 { if (src.hasSubject()) { tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); } - if (src.hasCreated()) { - tgt.setCreated(src.getCreated()); - } + if (src.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu3.model.DateType) VersionConvertor_10_30.convertType(src.getCreatedElement())); if (src.hasAuthor()) { tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); } 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 2d15a7b55..14ad2f73a 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.Base64BinaryType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Binary10_30 { @@ -10,11 +12,10 @@ 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); - if (src.hasContentType()) { - tgt.setContentType(src.getContentType()); - } - if (src.hasContent()) { - tgt.setContent(src.getContent()); + if (src.hasContentTypeElement()) + tgt.setContentTypeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getContentTypeElement())); + if (src.hasContentElement()) { + tgt.setContentElement((Base64BinaryType) VersionConvertor_10_30.convertType(src.getContentElement())); } return tgt; } @@ -24,11 +25,10 @@ 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); - if (src.hasContentType()) { - tgt.setContentType(src.getContentType()); - } - if (src.hasContent()) { - tgt.setContent(src.getContent()); + if (src.hasContentTypeElement()) + tgt.setContentTypeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getContentTypeElement())); + if (src.hasContentElement()) { + tgt.setContentElement((org.hl7.fhir.dstu3.model.Base64BinaryType) VersionConvertor_10_30.convertType(src.getContentElement())); } 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 d1eb6fbfc..40ead638e 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 @@ -2,7 +2,11 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertorAdvisor30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.DecimalType; +import org.hl7.fhir.dstu2.model.UriType; +import org.hl7.fhir.dstu3.model.UnsignedIntType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Bundle10_30 { @@ -14,8 +18,8 @@ public class Bundle10_30 { if (src.hasType()) { tgt.setType(convertBundleType(src.getType())); } - if (src.hasTotal()) - tgt.setTotal(src.getTotal()); + if (src.hasTotalElement()) + tgt.setTotalElement((UnsignedIntType) VersionConvertor_10_30.convertType(src.getTotalElement())); if (src.hasLink()) { for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); } @@ -36,8 +40,8 @@ public class Bundle10_30 { if (src.hasType()) { tgt.setType(convertBundleType(src.getType())); } - if (src.hasTotal()) - tgt.setTotal(src.getTotal()); + if (src.hasTotalElement()) + tgt.setTotalElement((org.hl7.fhir.dstu2.model.UnsignedIntType) VersionConvertor_10_30.convertType(src.getTotalElement())); if (src.hasLink()) { for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); } @@ -61,7 +65,7 @@ public class Bundle10_30 { org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent(); VersionConvertor_10_30.copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); - tgt.setFullUrl(src.getFullUrl()); + tgt.setFullUrlElement((UriType) VersionConvertor_10_30.convertType(src.getFullUrlElement())); org.hl7.fhir.dstu2.model.Resource res = advisor.convert(src.getResource()); if (res == null) res = VersionConvertor_10_30.convertResource(src.getResource()); @@ -87,9 +91,8 @@ public class Bundle10_30 { 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.hasFullUrlElement()) + tgt.setFullUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getFullUrlElement())); if (src.hasResource()) { tgt.setResource(VersionConvertor_10_30.convertResource(src.getResource())); } @@ -113,21 +116,16 @@ public class Bundle10_30 { 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()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasIfNoneMatchElement()) + tgt.setIfNoneMatchElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getIfNoneMatchElement())); + if (src.hasIfModifiedSinceElement()) + tgt.setIfModifiedSinceElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getIfModifiedSinceElement())); + if (src.hasIfMatchElement()) + tgt.setIfMatchElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getIfMatchElement())); + if (src.hasIfNoneExistElement()) + tgt.setIfNoneExistElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getIfNoneExistElement())); return tgt; } @@ -139,21 +137,16 @@ public class Bundle10_30 { 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()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasIfNoneMatchElement()) + tgt.setIfNoneMatchElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getIfNoneMatchElement())); + if (src.hasIfModifiedSinceElement()) + tgt.setIfModifiedSinceElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getIfModifiedSinceElement())); + if (src.hasIfMatchElement()) + tgt.setIfMatchElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getIfMatchElement())); + if (src.hasIfNoneExistElement()) + tgt.setIfNoneExistElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getIfNoneExistElement())); return tgt; } @@ -162,18 +155,14 @@ 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); - 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()); - } + if (src.hasStatusElement()) + tgt.setStatusElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getStatusElement())); + if (src.hasLocationElement()) + tgt.setLocationElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getLocationElement())); + if (src.hasEtagElement()) + tgt.setEtagElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getEtagElement())); + if (src.hasLastModifiedElement()) + tgt.setLastModifiedElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getLastModifiedElement())); return tgt; } @@ -182,18 +171,14 @@ 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); - 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()); - } + if (src.hasStatusElement()) + tgt.setStatusElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getStatusElement())); + if (src.hasLocationElement()) + tgt.setLocationElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getLocationElement())); + if (src.hasEtagElement()) + tgt.setEtagElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getEtagElement())); + if (src.hasLastModifiedElement()) + tgt.setLastModifiedElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getLastModifiedElement())); return tgt; } @@ -205,8 +190,8 @@ public class Bundle10_30 { if (src.hasMode()) { tgt.setMode(convertSearchEntryMode(src.getMode())); } - if (src.hasScore()) { - tgt.setScore(src.getScore()); + if (src.hasScoreElement()) { + tgt.setScoreElement((DecimalType) VersionConvertor_10_30.convertType(src.getScoreElement())); } return tgt; } @@ -219,8 +204,8 @@ public class Bundle10_30 { if (src.hasMode()) { tgt.setMode(convertSearchEntryMode(src.getMode())); } - if (src.hasScore()) { - tgt.setScore(src.getScore()); + if (src.hasScoreElement()) { + tgt.setScoreElement((org.hl7.fhir.dstu3.model.DecimalType) VersionConvertor_10_30.convertType(src.getScoreElement())); } return tgt; } @@ -230,12 +215,10 @@ 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); - if (src.hasRelation()) { - tgt.setRelation(src.getRelation()); - } - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasRelationElement()) + tgt.setRelationElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getRelationElement())); + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); return tgt; } @@ -244,12 +227,10 @@ 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); - if (src.hasRelation()) { - tgt.setRelation(src.getRelation()); - } - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasRelationElement()) + tgt.setRelationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getRelationElement())); + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); 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 d5fcaf7af..68b7739b2 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class CarePlan10_30 { @@ -31,9 +33,8 @@ public class CarePlan10_30 { 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasAddresses()) { for (org.hl7.fhir.dstu2.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_30.convertReference(t)); } @@ -72,9 +73,8 @@ public class CarePlan10_30 { 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasAddresses()) { for (org.hl7.fhir.dstu3.model.Reference t : src.getAddresses()) tgt.addAddresses(VersionConvertor_10_30.convertReference(t)); } @@ -144,8 +144,8 @@ public class CarePlan10_30 { if (src.hasStatus()) { tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); } - if (src.hasProhibited()) { - tgt.setProhibited(src.getProhibited()); + if (src.hasProhibitedElement()) { + tgt.setProhibitedElement((BooleanType) VersionConvertor_10_30.convertType(src.getProhibitedElement())); } if (src.hasScheduled()) { tgt.setScheduled(VersionConvertor_10_30.convertType(src.getScheduled())); @@ -165,9 +165,8 @@ public class CarePlan10_30 { if (src.hasQuantity()) { tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); return tgt; } @@ -194,8 +193,8 @@ public class CarePlan10_30 { if (src.hasStatus()) { tgt.setStatus(convertCarePlanActivityStatus(src.getStatus())); } - if (src.hasProhibited()) { - tgt.setProhibited(src.getProhibited()); + if (src.hasProhibitedElement()) { + tgt.setProhibitedElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getProhibitedElement())); } if (src.hasScheduled()) { tgt.setScheduled(VersionConvertor_10_30.convertType(src.getScheduled())); @@ -215,9 +214,8 @@ public class CarePlan10_30 { if (src.hasQuantity()) { tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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 085624c3e..15fbe8458 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 @@ -1,8 +1,10 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.StringType; import org.hl7.fhir.dstu3.model.UriType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class ClinicalImpression10_30 { @@ -20,28 +22,25 @@ public class ClinicalImpression10_30 { if (src.hasStatus()) { tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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.hasProtocolElement()) + tgt.setProtocol(Collections.singletonList((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getProtocolElement()))); + if (src.hasSummaryElement()) + tgt.setSummaryElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getSummaryElement())); 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()); + if (src.hasPrognosisElement()) + tgt.addPrognosisCodeableConcept().setTextElement((StringType) VersionConvertor_10_30.convertType(src.getPrognosisElement())); if (src.hasAction()) { for (org.hl7.fhir.dstu2.model.Reference t : src.getAction()) tgt.addAction(VersionConvertor_10_30.convertReference(t)); } @@ -62,11 +61,10 @@ public class ClinicalImpression10_30 { if (src.hasStatus()) { tgt.setStatus(convertClinicalImpressionStatus(src.getStatus())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasPrevious()) { tgt.setPrevious(VersionConvertor_10_30.convertReference(src.getPrevious())); } @@ -76,9 +74,8 @@ public class ClinicalImpression10_30 { if (src.hasProtocol()) { for (UriType t : src.getProtocol()) tgt.setProtocol(t.asStringValue()); } - if (src.hasSummary()) { - tgt.setSummary(src.getSummary()); - } + if (src.hasSummaryElement()) + tgt.setSummaryElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getSummaryElement())); if (src.hasFinding()) { for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t)); } 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 a6077ae79..98194f78b 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Communication10_30 { @@ -34,12 +35,10 @@ public class Communication10_30 { 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.hasSentElement()) + tgt.setSentElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getSentElement())); + if (src.hasReceivedElement()) + tgt.setReceivedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getReceivedElement())); if (src.hasReason()) { for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(t)); } @@ -78,12 +77,10 @@ public class Communication10_30 { 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.hasSentElement()) + tgt.setSentElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getSentElement())); + if (src.hasReceivedElement()) + tgt.setReceivedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getReceivedElement())); if (src.hasReasonCode()) { for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(VersionConvertor_10_30.convertCodeableConcept(t)); } 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 7f9cba1c5..dd3a301e2 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.DateTimeType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class CommunicationRequest10_30 { @@ -43,8 +45,8 @@ public class CommunicationRequest10_30 { 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.hasAuthoredOnElement()) { + tgt.setRequestedOnElement((DateTimeType) VersionConvertor_10_30.convertType(src.getAuthoredOnElement())); } if (src.hasSubject()) { tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); @@ -93,8 +95,8 @@ public class CommunicationRequest10_30 { 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.hasRequestedOnElement()) { + tgt.setAuthoredOnElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getRequestedOnElement())); } if (src.hasSubject()) { tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); 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 20defc7c3..45f300ea3 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Composition10_30 { @@ -13,17 +14,16 @@ public class Composition10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); 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.hasTitleElement()) + tgt.setTitleElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTitleElement())); if (src.hasStatus()) { tgt.setStatus(convertCompositionStatus(src.getStatus())); } @@ -66,17 +66,16 @@ public class Composition10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); 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.hasTitleElement()) + tgt.setTitleElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTitleElement())); if (src.hasStatus()) { tgt.setStatus(convertCompositionStatus(src.getStatus())); } @@ -149,9 +148,8 @@ public class Composition10_30 { 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.hasTimeElement()) + tgt.setTimeElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getTimeElement())); if (src.hasParty()) { tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); } @@ -166,9 +164,8 @@ public class Composition10_30 { 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.hasTimeElement()) + tgt.setTimeElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getTimeElement())); if (src.hasParty()) { tgt.setParty(VersionConvertor_10_30.convertReference(src.getParty())); } @@ -248,9 +245,8 @@ 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); - if (src.hasTitle()) { - tgt.setTitle(src.getTitle()); - } + if (src.hasTitleElement()) + tgt.setTitleElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTitleElement())); if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } @@ -284,9 +280,8 @@ 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); - if (src.hasTitle()) { - tgt.setTitle(src.getTitle()); - } + if (src.hasTitleElement()) + tgt.setTitleElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTitleElement())); if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } 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 b2237975e..671ef0114 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 @@ -1,11 +1,16 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; +import org.hl7.fhir.dstu2.model.StringType; +import org.hl7.fhir.dstu3.model.CodeType; import org.hl7.fhir.dstu3.model.ConceptMap; import org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent; +import org.hl7.fhir.dstu3.model.UriType; import org.hl7.fhir.exceptions.FHIRException; import java.util.ArrayList; import java.util.List; +import java.util.Collections; public class ConceptMap10_30 { @@ -14,34 +19,29 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); 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.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); if (src.hasJurisdiction()) { @@ -50,9 +50,8 @@ public class ConceptMap10_30 { if (src.hasPurpose()) { tgt.setRequirements(src.getPurpose()); } - if (src.hasCopyright()) { - tgt.setCopyright(src.getCopyright()); - } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); if (src.hasSource()) { tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); } @@ -70,34 +69,29 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); 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.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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()); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else @@ -105,9 +99,8 @@ public class ConceptMap10_30 { if (src.hasRequirements()) { tgt.setPurpose(src.getRequirements()); } - if (src.hasCopyright()) { - tgt.setCopyright(src.getCopyright()); - } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); if (src.hasSource()) { tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); } @@ -126,9 +119,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -140,9 +132,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -208,15 +199,14 @@ 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); - if (src.hasElement()) { - tgt.setProperty(src.getElement()); + if (src.hasElementElement()) { + tgt.setPropertyElement((UriType) VersionConvertor_10_30.convertType(src.getElementElement())); } if (src.hasCodeSystem()) { tgt.setSystem(src.getCodeSystem()); } - if (src.hasCode()) { - tgt.setCode(src.getCode()); - } + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCodeElement())); return tgt; } @@ -231,9 +221,8 @@ public class ConceptMap10_30 { if (src.hasSystem()) { tgt.setCodeSystem(src.getSystem()); } - if (src.hasCode()) { - tgt.setCode(src.getCode()); - } + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCodeElement())); return tgt; } @@ -244,8 +233,8 @@ 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); - if (src.hasCode()) { - tgt.setCode(src.getCode()); + if (src.hasCodeElement()) { + tgt.setCodeElement((CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); } tgt.addTarget(convertTargetElementComponent(t)); if (src.hasCodeSystem()) { @@ -261,9 +250,8 @@ 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()); - if (src.hasCode()) { - tgt.setCode(src.getCode()); - } + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); if (src.hasTarget()) { for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g)); } @@ -276,14 +264,13 @@ 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()); - if (src.hasCode()) { - tgt.setCode(src.getCode()); - } + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); if (src.hasEquivalence()) { tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); } - if (src.hasComment()) { - tgt.setComments(src.getComment()); + if (src.hasCommentElement()) { + tgt.setCommentsElement((StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); } if (src.hasDependsOn()) { for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); @@ -299,14 +286,13 @@ 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); - if (src.hasCode()) { - tgt.setCode(src.getCode()); - } + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); if (src.hasEquivalence()) { tgt.setEquivalence(convertConceptMapEquivalence(src.getEquivalence())); } - if (src.hasComments()) { - tgt.setComment(src.getComments()); + if (src.hasCommentsElement()) { + tgt.setCommentElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCommentsElement())); } if (src.hasDependsOn()) { for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t)); 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 ac00e90cc..5ef3b97c0 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.DateTimeType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Condition10_30 { @@ -22,8 +24,8 @@ public class Condition10_30 { if (src.hasAsserter()) { tgt.setAsserter(VersionConvertor_10_30.convertReference(src.getAsserter())); } - if (src.hasDateRecorded()) - tgt.setAssertedDate(src.getDateRecorded()); + if (src.hasDateRecordedElement()) + tgt.setAssertedDateElement((DateTimeType) VersionConvertor_10_30.convertType(src.getDateRecordedElement())); if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } 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 03eb3f7c4..391c8a7e8 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 @@ -1,8 +1,16 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.Base64BinaryType; +import org.hl7.fhir.dstu2.model.BooleanType; +import org.hl7.fhir.dstu2.model.StringType; +import org.hl7.fhir.dstu2.model.UriType; import org.hl7.fhir.dstu3.model.CapabilityStatement.SystemRestfulInteraction; +import org.hl7.fhir.dstu3.model.DateTimeType; +import org.hl7.fhir.dstu3.model.MarkdownType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; +import java.util.stream.Collectors; public class Conformance10_30 { @@ -41,37 +49,31 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasPurposeElement()) { + tgt.setRequirementsElement((StringType) VersionConvertor_10_30.convertType(src.getPurposeElement())); } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); if (src.hasKind()) { tgt.setKind(convertConformanceStatementKind(src.getKind())); } @@ -80,9 +82,8 @@ public class Conformance10_30 { } if (src.hasImplementation()) tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); - if (src.hasFhirVersion()) { - tgt.setFhirVersion(src.getFhirVersion()); - } + if (src.hasFhirVersionElement()) + tgt.setFhirVersionElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getFhirVersionElement())); if (src.hasAcceptUnknown()) { tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); } @@ -109,25 +110,21 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); if (src.hasContact()) { for (org.hl7.fhir.dstu2.model.Conformance.ConformanceContactComponent t : src.getContact()) tgt.addContact(convertConformanceContactComponent(t)); } @@ -149,9 +146,8 @@ public class Conformance10_30 { if (src.hasImplementation()) { tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation())); } - if (src.hasFhirVersion()) { - tgt.setFhirVersion(src.getFhirVersion()); - } + if (src.hasFhirVersionElement()) + tgt.setFhirVersionElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getFhirVersionElement())); if (src.hasAcceptUnknown()) { tgt.setAcceptUnknown(convertUnknownContentCode(src.getAcceptUnknown())); } @@ -178,9 +174,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -192,9 +187,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -209,8 +203,8 @@ public class Conformance10_30 { if (src.hasMode()) { tgt.setMode(convertDocumentMode(src.getMode())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } if (src.hasProfile()) { tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); @@ -226,8 +220,8 @@ public class Conformance10_30 { if (src.hasMode()) { tgt.setMode(convertDocumentMode(src.getMode())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } if (src.hasProfile()) { tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); @@ -266,12 +260,10 @@ 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); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); return tgt; } @@ -280,12 +272,10 @@ 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); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); return tgt; } @@ -300,8 +290,8 @@ public class Conformance10_30 { if (src.hasReliableCache()) { tgt.setReliableCache(src.getReliableCache()); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } if (src.hasEvent()) { for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); @@ -320,8 +310,8 @@ public class Conformance10_30 { if (src.hasReliableCache()) { tgt.setReliableCache(src.getReliableCache()); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } if (src.hasEvent()) { for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) tgt.addEvent(convertConformanceMessagingEventComponent(t)); @@ -380,8 +370,8 @@ public class Conformance10_30 { if (src.hasResponse()) { tgt.setResponse(VersionConvertor_10_30.convertReference(src.getResponse())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } return tgt; } @@ -409,8 +399,8 @@ public class Conformance10_30 { if (src.hasResponse()) { tgt.setResponse(VersionConvertor_10_30.convertReference(src.getResponse())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } return tgt; } @@ -423,8 +413,8 @@ public class Conformance10_30 { if (src.hasMode()) { tgt.setMode(convertRestfulConformanceMode(src.getMode())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } if (src.hasSecurity()) { tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); @@ -457,8 +447,8 @@ public class Conformance10_30 { if (src.hasMode()) { tgt.setMode(convertRestfulConformanceMode(src.getMode())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } if (src.hasSecurity()) { tgt.setSecurity(convertConformanceRestSecurityComponent(src.getSecurity())); @@ -497,9 +487,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasDefinition()) { tgt.setDefinition(VersionConvertor_10_30.convertReference(src.getDefinition())); } @@ -511,9 +500,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasDefinition()) { tgt.setDefinition(VersionConvertor_10_30.convertReference(src.getDefinition())); } @@ -536,17 +524,17 @@ public class Conformance10_30 { if (src.hasVersioning()) { tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); } - if (src.hasReadHistory()) { - tgt.setReadHistory(src.getReadHistory()); + if (src.hasReadHistoryElement()) { + tgt.setReadHistoryElement((BooleanType) VersionConvertor_10_30.convertType(src.getReadHistoryElement())); } - if (src.hasUpdateCreate()) { - tgt.setUpdateCreate(src.getUpdateCreate()); + if (src.hasUpdateCreateElement()) { + tgt.setUpdateCreateElement((BooleanType) VersionConvertor_10_30.convertType(src.getUpdateCreateElement())); } - if (src.hasConditionalCreate()) { - tgt.setConditionalCreate(src.getConditionalCreate()); + if (src.hasConditionalCreateElement()) { + tgt.setConditionalCreateElement((BooleanType) VersionConvertor_10_30.convertType(src.getConditionalCreateElement())); } - if (src.hasConditionalUpdate()) { - tgt.setConditionalUpdate(src.getConditionalUpdate()); + if (src.hasConditionalUpdateElement()) { + tgt.setConditionalUpdateElement((BooleanType) VersionConvertor_10_30.convertType(src.getConditionalUpdateElement())); } if (src.hasConditionalDelete()) { tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); @@ -580,17 +568,17 @@ public class Conformance10_30 { if (src.hasVersioning()) { tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning())); } - if (src.hasReadHistory()) { - tgt.setReadHistory(src.getReadHistory()); + if (src.hasReadHistoryElement()) { + tgt.setReadHistoryElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getReadHistoryElement())); } - if (src.hasUpdateCreate()) { - tgt.setUpdateCreate(src.getUpdateCreate()); + if (src.hasUpdateCreateElement()) { + tgt.setUpdateCreateElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getUpdateCreateElement())); } - if (src.hasConditionalCreate()) { - tgt.setConditionalCreate(src.getConditionalCreate()); + if (src.hasConditionalCreateElement()) { + tgt.setConditionalCreateElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getConditionalCreateElement())); } - if (src.hasConditionalUpdate()) { - tgt.setConditionalUpdate(src.getConditionalUpdate()); + if (src.hasConditionalUpdateElement()) { + tgt.setConditionalUpdateElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getConditionalUpdateElement())); } if (src.hasConditionalDelete()) { tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete())); @@ -612,17 +600,16 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasDefinition()) { - tgt.setDefinition(src.getDefinition()); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDefinitionElement()) { + tgt.setDefinitionElement((UriType) VersionConvertor_10_30.convertType(src.getDefinitionElement())); } if (src.hasType()) { tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } return tgt; } @@ -632,17 +619,16 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasDefinition()) { - tgt.setDefinition(src.getDefinition()); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDefinitionElement()) { + tgt.setDefinitionElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getDefinitionElement())); } if (src.hasType()) { tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } return tgt; } @@ -655,8 +641,8 @@ public class Conformance10_30 { if (src.hasType()) { tgt.setType(src.getType()); } - if (src.hasBlob()) { - tgt.setBlob(src.getBlob()); + if (src.hasBlobElement()) { + tgt.setBlobElement((Base64BinaryType) VersionConvertor_10_30.convertType(src.getBlobElement())); } return tgt; } @@ -669,8 +655,8 @@ public class Conformance10_30 { if (src.hasType()) { tgt.setType(src.getType()); } - if (src.hasBlob()) { - tgt.setBlob(src.getBlob()); + if (src.hasBlobElement()) { + tgt.setBlobElement((org.hl7.fhir.dstu3.model.Base64BinaryType) VersionConvertor_10_30.convertType(src.getBlobElement())); } return tgt; } @@ -680,15 +666,14 @@ 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); - if (src.hasCors()) { - tgt.setCors(src.getCors()); + if (src.hasCorsElement()) { + tgt.setCorsElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getCorsElement())); } 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasCertificate()) { for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); } @@ -700,15 +685,14 @@ 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); - if (src.hasCors()) { - tgt.setCors(src.getCors()); + if (src.hasCorsElement()) { + tgt.setCorsElement((BooleanType) VersionConvertor_10_30.convertType(src.getCorsElement())); } 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasCertificate()) { for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent t : src.getCertificate()) tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t)); } @@ -720,14 +704,12 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasReleaseDate()) { - tgt.setReleaseDate(src.getReleaseDate()); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasReleaseDateElement()) { + tgt.setReleaseDateElement((DateTimeType) VersionConvertor_10_30.convertType(src.getReleaseDateElement())); } return tgt; } @@ -737,14 +719,12 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasReleaseDate()) { - tgt.setReleaseDate(src.getReleaseDate()); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasReleaseDateElement()) { + tgt.setReleaseDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getReleaseDateElement())); } return tgt; } @@ -843,8 +823,8 @@ public class Conformance10_30 { if (src.hasCode()) { tgt.setCode(convertTypeRestfulInteraction(src.getCode())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } return tgt; } @@ -857,8 +837,8 @@ public class Conformance10_30 { if (src.hasCode()) { tgt.setCode(convertTypeRestfulInteraction(src.getCode())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } return tgt; } @@ -927,8 +907,8 @@ public class Conformance10_30 { if (src.hasCode()) { tgt.setCode(convertSystemRestfulInteraction(src.getCode())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } return tgt; } @@ -941,8 +921,8 @@ public class Conformance10_30 { if (src.hasCode()) { tgt.setCode(convertSystemRestfulInteraction(src.getCode())); } - if (src.hasDocumentation()) { - tgt.setDocumentation(src.getDocumentation()); + if (src.hasDocumentationElement()) { + tgt.setDocumentationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); } 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 ba5295628..798c12b1a 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 @@ -2,7 +2,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.apache.commons.codec.binary.Base64; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.DecimalType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Contract10_30 { @@ -64,9 +66,8 @@ public class Contract10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasIssued()) { - tgt.setIssued(src.getIssued()); - } + if (src.hasIssuedElement()) + tgt.setIssuedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getIssuedElement())); if (src.hasApplies()) { tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); } @@ -126,9 +127,8 @@ public class Contract10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasIssued()) { - tgt.setIssued(src.getIssued()); - } + if (src.hasIssuedElement()) + tgt.setIssuedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getIssuedElement())); if (src.hasApplies()) { tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); } @@ -293,9 +293,8 @@ public class Contract10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasIssued()) { - tgt.setIssued(src.getIssued()); - } + if (src.hasIssuedElement()) + tgt.setIssuedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getIssuedElement())); if (src.hasApplies()) { tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); } @@ -314,9 +313,8 @@ public class Contract10_30 { 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.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); if (src.hasValuedItem()) { for (org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t)); } @@ -334,9 +332,8 @@ public class Contract10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasIssued()) { - tgt.setIssued(src.getIssued()); - } + if (src.hasIssuedElement()) + tgt.setIssuedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getIssuedElement())); if (src.hasApplies()) { tgt.setApplies(VersionConvertor_10_30.convertPeriod(src.getApplies())); } @@ -355,9 +352,8 @@ public class Contract10_30 { 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.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); if (src.hasValuedItem()) { for (org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t)); } @@ -378,20 +374,19 @@ public class Contract10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasEffectiveTime()) { - tgt.setEffectiveTime(src.getEffectiveTime()); - } + if (src.hasEffectiveTimeElement()) + tgt.setEffectiveTimeElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getEffectiveTimeElement())); 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.hasFactorElement()) { + tgt.setFactorElement((DecimalType) VersionConvertor_10_30.convertType(src.getFactorElement())); } - if (src.hasPoints()) { - tgt.setPoints(src.getPoints()); + if (src.hasPointsElement()) { + tgt.setPointsElement((DecimalType) VersionConvertor_10_30.convertType(src.getPointsElement())); } if (src.hasNet()) { tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); @@ -410,20 +405,19 @@ public class Contract10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasEffectiveTime()) { - tgt.setEffectiveTime(src.getEffectiveTime()); - } + if (src.hasEffectiveTimeElement()) + tgt.setEffectiveTimeElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getEffectiveTimeElement())); 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.hasFactorElement()) { + tgt.setFactorElement((org.hl7.fhir.dstu3.model.DecimalType) VersionConvertor_10_30.convertType(src.getFactorElement())); } - if (src.hasPoints()) { - tgt.setPoints(src.getPoints()); + if (src.hasPointsElement()) { + tgt.setPointsElement((org.hl7.fhir.dstu3.model.DecimalType) VersionConvertor_10_30.convertType(src.getPointsElement())); } if (src.hasNet()) { tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); @@ -442,20 +436,19 @@ public class Contract10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasEffectiveTime()) { - tgt.setEffectiveTime(src.getEffectiveTime()); - } + if (src.hasEffectiveTimeElement()) + tgt.setEffectiveTimeElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getEffectiveTimeElement())); 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.hasFactorElement()) { + tgt.setFactorElement((DecimalType) VersionConvertor_10_30.convertType(src.getFactorElement())); } - if (src.hasPoints()) { - tgt.setPoints(src.getPoints()); + if (src.hasPointsElement()) { + tgt.setPointsElement((DecimalType) VersionConvertor_10_30.convertType(src.getPointsElement())); } if (src.hasNet()) { tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); @@ -474,20 +467,19 @@ public class Contract10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasEffectiveTime()) { - tgt.setEffectiveTime(src.getEffectiveTime()); - } + if (src.hasEffectiveTimeElement()) + tgt.setEffectiveTimeElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getEffectiveTimeElement())); 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.hasFactorElement()) { + tgt.setFactorElement((org.hl7.fhir.dstu3.model.DecimalType) VersionConvertor_10_30.convertType(src.getFactorElement())); } - if (src.hasPoints()) { - tgt.setPoints(src.getPoints()); + if (src.hasPointsElement()) { + tgt.setPointsElement((org.hl7.fhir.dstu3.model.DecimalType) VersionConvertor_10_30.convertType(src.getPointsElement())); } if (src.hasNet()) { tgt.setNet(VersionConvertor_10_30.convertMoney(src.getNet())); 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 b38b8020e..4475001e1 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 @@ -1,9 +1,12 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; +import org.hl7.fhir.dstu2.model.StringType; import org.hl7.fhir.exceptions.FHIRException; import java.util.ArrayList; import java.util.List; +import java.util.Collections; public class DataElement10_30 { @@ -12,28 +15,24 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); 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.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } - if (src.hasDate()) - tgt.setDate(src.getDate()); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasContact()) { for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); } @@ -42,9 +41,8 @@ public class DataElement10_30 { 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.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); if (src.hasStringency()) { tgt.setStringency(convertDataElementStringency(src.getStringency())); } @@ -62,28 +60,24 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); 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.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } - if (src.hasDate()) - tgt.setDate(src.getDate()); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasContact()) { for (org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t)); } @@ -91,9 +85,8 @@ public class DataElement10_30 { tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else tgt.addUseContext(VersionConvertor_10_30.convertCodeableConceptToUsageContext(t)); - if (src.hasCopyright()) { - tgt.setCopyright(src.getCopyright()); - } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); if (src.hasStringency()) { tgt.setStringency(convertDataElementStringency(src.getStringency())); } @@ -114,9 +107,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -128,9 +120,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -142,15 +133,12 @@ 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); - if (src.hasIdentity()) { - tgt.setIdentity(src.getIdentity()); - } - if (src.hasUri()) { - tgt.setUri(src.getUri()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasIdentityElement()) + tgt.setIdentityElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getIdentityElement())); + if (src.hasUriElement()) + tgt.setUriElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUriElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasComments()) { tgt.setComment(src.getComments()); } @@ -162,17 +150,14 @@ 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); - 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()); + if (src.hasIdentityElement()) + tgt.setIdentityElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getIdentityElement())); + if (src.hasUriElement()) + tgt.setUriElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUriElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasCommentElement()) { + tgt.setCommentsElement((StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); } 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 41bc4ab84..8b76977f5 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class DetectedIssue10_30 { @@ -22,20 +23,18 @@ public class DetectedIssue10_30 { 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()); + if (src.hasDetailElement()) + tgt.setDetailElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDetailElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); 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.hasReferenceElement()) + tgt.setReferenceElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getReferenceElement())); if (src.hasMitigation()) { for (org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); } @@ -59,20 +58,18 @@ public class DetectedIssue10_30 { 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()); + if (src.hasDetailElement()) + tgt.setDetailElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDetailElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); 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.hasReferenceElement()) + tgt.setReferenceElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getReferenceElement())); if (src.hasMitigation()) { for (org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); } @@ -87,8 +84,8 @@ public class DetectedIssue10_30 { if (src.hasAction()) { tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasAuthor()) { tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); } @@ -103,8 +100,8 @@ public class DetectedIssue10_30 { if (src.hasAction()) { tgt.setAction(VersionConvertor_10_30.convertCodeableConcept(src.getAction())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasAuthor()) { tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); } 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 210f8861a..6de92be8f 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.DateTimeType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Device10_30 { @@ -21,24 +23,19 @@ public class Device10_30 { 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.hasLotNumberElement()) + tgt.setLotNumberElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getLotNumberElement())); + if (src.hasManufacturerElement()) + tgt.setManufacturerElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getManufacturerElement())); + if (src.hasManufactureDateElement()) + tgt.setManufactureDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getManufactureDateElement())); + if (src.hasExpirationDateElement()) { + tgt.setExpiryElement((DateTimeType) VersionConvertor_10_30.convertType(src.getExpirationDateElement())); } + if (src.hasModelElement()) + tgt.setModelElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getModelElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); if (src.hasPatient()) { tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); } @@ -51,9 +48,8 @@ public class Device10_30 { if (src.hasLocation()) { tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); } - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); if (src.hasNote()) { for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); } @@ -77,24 +73,19 @@ public class Device10_30 { 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.hasLotNumberElement()) + tgt.setLotNumberElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getLotNumberElement())); + if (src.hasManufacturerElement()) + tgt.setManufacturerElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getManufacturerElement())); + if (src.hasManufactureDateElement()) + tgt.setManufactureDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getManufactureDateElement())); + if (src.hasExpiryElement()) { + tgt.setExpirationDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getExpiryElement())); } + if (src.hasModelElement()) + tgt.setModelElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getModelElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); if (src.hasPatient()) { tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); } @@ -107,9 +98,8 @@ public class Device10_30 { if (src.hasLocation()) { tgt.setLocation(VersionConvertor_10_30.convertReference(src.getLocation())); } - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); if (src.hasNote()) { for (org.hl7.fhir.dstu2.model.Annotation t : src.getNote()) tgt.addNote(VersionConvertor_10_30.convertAnnotation(t)); } 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 36b418a37..8f486d8d1 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class DeviceComponent10_30 { @@ -16,9 +17,8 @@ public class DeviceComponent10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasLastSystemChange()) { - tgt.setLastSystemChange(src.getLastSystemChange()); - } + if (src.hasLastSystemChangeElement()) + tgt.setLastSystemChangeElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getLastSystemChangeElement())); if (src.hasSource()) { tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); } @@ -54,9 +54,8 @@ public class DeviceComponent10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasLastSystemChange()) { - tgt.setLastSystemChange(src.getLastSystemChange()); - } + if (src.hasLastSystemChangeElement()) + tgt.setLastSystemChangeElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getLastSystemChangeElement())); if (src.hasSource()) { tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); } @@ -92,9 +91,8 @@ public class DeviceComponent10_30 { if (src.hasComponentId()) { tgt.setComponentId(VersionConvertor_10_30.convertIdentifier(src.getComponentId())); } - if (src.hasProductionSpec()) { - tgt.setProductionSpec(src.getProductionSpec()); - } + if (src.hasProductionSpecElement()) + tgt.setProductionSpecElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getProductionSpecElement())); return tgt; } @@ -109,9 +107,8 @@ public class DeviceComponent10_30 { if (src.hasComponentId()) { tgt.setComponentId(VersionConvertor_10_30.convertIdentifier(src.getComponentId())); } - if (src.hasProductionSpec()) { - tgt.setProductionSpec(src.getProductionSpec()); - } + if (src.hasProductionSpecElement()) + tgt.setProductionSpecElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getProductionSpecElement())); 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 0444f24a3..bf7ae63ca 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class DeviceMetric10_30 { @@ -92,9 +93,8 @@ public class DeviceMetric10_30 { if (src.hasState()) { tgt.setState(convertDeviceMetricCalibrationState(src.getState())); } - if (src.hasTime()) { - tgt.setTime(src.getTime()); - } + if (src.hasTimeElement()) + tgt.setTimeElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getTimeElement())); return tgt; } @@ -109,9 +109,8 @@ public class DeviceMetric10_30 { if (src.hasState()) { tgt.setState(convertDeviceMetricCalibrationState(src.getState())); } - if (src.hasTime()) { - tgt.setTime(src.getTime()); - } + if (src.hasTimeElement()) + tgt.setTimeElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getTimeElement())); 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 3848e19d4..b64a023c5 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 @@ -3,6 +3,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.dstu3.model.Annotation; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class DeviceUseStatement10_30 { @@ -29,9 +30,8 @@ public class DeviceUseStatement10_30 { if (src.hasNote()) { for (Annotation t : src.getNote()) tgt.addNotes(t.getText()); } - if (src.hasRecordedOn()) { - tgt.setRecordedOn(src.getRecordedOn()); - } + if (src.hasRecordedOnElement()) + tgt.setRecordedOnElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getRecordedOnElement())); if (src.hasSubject()) { tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); } @@ -63,9 +63,8 @@ public class DeviceUseStatement10_30 { 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.hasRecordedOnElement()) + tgt.setRecordedOnElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getRecordedOnElement())); if (src.hasSubject()) { tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); } 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 ae774cba9..dad970f60 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class DiagnosticReport10_30 { @@ -31,9 +32,8 @@ public class DiagnosticReport10_30 { if (src.hasEffective()) { tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); } - if (src.hasIssued()) { - tgt.setIssued(src.getIssued()); - } + if (src.hasIssuedElement()) + tgt.setIssuedElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getIssuedElement())); if (src.hasBasedOn()) { for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addRequest(VersionConvertor_10_30.convertReference(t)); } @@ -49,9 +49,8 @@ public class DiagnosticReport10_30 { 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.hasConclusionElement()) + tgt.setConclusionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getConclusionElement())); if (src.hasCodedDiagnosis()) { for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addCodedDiagnosis(VersionConvertor_10_30.convertCodeableConcept(t)); } @@ -87,9 +86,8 @@ public class DiagnosticReport10_30 { if (src.hasEffective()) { tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); } - if (src.hasIssued()) { - tgt.setIssued(src.getIssued()); - } + if (src.hasIssuedElement()) + tgt.setIssuedElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getIssuedElement())); if (src.hasRequest()) { for (org.hl7.fhir.dstu2.model.Reference t : src.getRequest()) tgt.addBasedOn(VersionConvertor_10_30.convertReference(t)); } @@ -105,9 +103,8 @@ public class DiagnosticReport10_30 { 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.hasConclusionElement()) + tgt.setConclusionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getConclusionElement())); if (src.hasCodedDiagnosis()) { for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCodedDiagnosis()) tgt.addCodedDiagnosis(VersionConvertor_10_30.convertCodeableConcept(t)); } @@ -122,9 +119,8 @@ 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); - if (src.hasComment()) { - tgt.setComment(src.getComment()); - } + if (src.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); if (src.hasLink()) { tgt.setLink(VersionConvertor_10_30.convertReference(src.getLink())); } @@ -136,9 +132,8 @@ 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); - if (src.hasComment()) { - tgt.setComment(src.getComment()); - } + if (src.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); if (src.hasLink()) { tgt.setLink(VersionConvertor_10_30.convertReference(src.getLink())); } 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 79d602bdc..4ae34fbbf 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class DocumentManifest10_30 { @@ -28,18 +29,15 @@ public class DocumentManifest10_30 { 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.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getCreatedElement())); + if (src.hasSourceElement()) + tgt.setSourceElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getSourceElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasContent()) { for (org.hl7.fhir.dstu3.model.DocumentManifest.DocumentManifestContentComponent t : src.getContent()) tgt.addContent(convertDocumentManifestContentComponent(t)); } @@ -72,18 +70,15 @@ public class DocumentManifest10_30 { 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.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getCreatedElement())); + if (src.hasSourceElement()) + tgt.setSourceElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getSourceElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasContent()) { for (org.hl7.fhir.dstu2.model.DocumentManifest.DocumentManifestContentComponent t : src.getContent()) tgt.addContent(convertDocumentManifestContentComponent(t)); } 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 eea210aca..e3f8cd252 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 @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.dstu2.model.CodeableConcept; import org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class DocumentReference10_30 { @@ -69,12 +70,10 @@ public class DocumentReference10_30 { 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.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getCreatedElement())); + if (src.hasIndexedElement()) + tgt.setIndexedElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getIndexedElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); } @@ -84,9 +83,8 @@ public class DocumentReference10_30 { 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasSecurityLabel()) { for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCodeableConcept(t)); } @@ -128,12 +126,10 @@ public class DocumentReference10_30 { 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.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getCreatedElement())); + if (src.hasIndexedElement()) + tgt.setIndexedElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getIndexedElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertDocumentReferenceStatus(src.getStatus())); } @@ -143,9 +139,8 @@ public class DocumentReference10_30 { 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasSecurityLabel()) { for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(VersionConvertor_10_30.convertCodeableConcept(t)); } 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 a3be80529..c01a1472b 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Encounter10_30 { 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 e0d6a1ef8..1d29d008b 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class EnrollmentRequest10_30 { @@ -13,9 +14,8 @@ public class EnrollmentRequest10_30 { 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.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getCreatedElement())); if (src.hasProvider()) { tgt.setProvider(VersionConvertor_10_30.convertReference(src.getProvider())); } @@ -39,9 +39,8 @@ public class EnrollmentRequest10_30 { 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.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getCreatedElement())); if (src.hasCoverage()) { tgt.setCoverage(VersionConvertor_10_30.convertReference(src.getCoverage())); } 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 3e74d2433..931b293b4 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class EnrollmentResponse10_30 { @@ -16,12 +17,10 @@ public class EnrollmentResponse10_30 { 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.hasDispositionElement()) + tgt.setDispositionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDispositionElement())); + if (src.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getCreatedElement())); if (src.hasOrganization()) { tgt.setOrganization(VersionConvertor_10_30.convertReference(src.getOrganization())); } @@ -42,12 +41,10 @@ public class EnrollmentResponse10_30 { 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()); - } + if (src.hasDispositionElement()) + tgt.setDispositionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDispositionElement())); + if (src.hasCreatedElement()) + tgt.setCreatedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getCreatedElement())); 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 ac5535b2c..ac69d4a71 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class EpisodeOfCare10_30 { 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 6ac0e5d56..360006fa4 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class FamilyMemberHistory10_30 { @@ -50,14 +51,13 @@ public class FamilyMemberHistory10_30 { if (src.hasPatient()) { tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasStatus()) { tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasRelationship()) { tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); } @@ -90,14 +90,13 @@ public class FamilyMemberHistory10_30 { if (src.hasPatient()) { tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasStatus()) { tgt.setStatus(convertFamilyHistoryStatus(src.getStatus())); } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasRelationship()) { tgt.setRelationship(VersionConvertor_10_30.convertCodeableConcept(src.getRelationship())); } 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 eeaf5868a..65593fe2e 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Flag10_30 { 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 0958d0c32..48d9c7fd7 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 @@ -1,7 +1,10 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; +import org.hl7.fhir.dstu2.model.UnsignedIntType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Group10_30 { @@ -16,17 +19,16 @@ public class Group10_30 { if (src.hasType()) { tgt.setType(convertGroupType(src.getType())); } - if (src.hasActual()) { - tgt.setActual(src.getActual()); + if (src.hasActualElement()) { + tgt.setActualElement((BooleanType) VersionConvertor_10_30.convertType(src.getActualElement())); } 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.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasQuantityElement()) { + tgt.setQuantityElement((UnsignedIntType) VersionConvertor_10_30.convertType(src.getQuantityElement())); } if (src.hasCharacteristic()) { for (org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); @@ -48,17 +50,16 @@ public class Group10_30 { if (src.hasType()) { tgt.setType(convertGroupType(src.getType())); } - if (src.hasActual()) { - tgt.setActual(src.getActual()); + if (src.hasActualElement()) { + tgt.setActualElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getActualElement())); } 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.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasQuantityElement()) { + tgt.setQuantityElement((org.hl7.fhir.dstu3.model.UnsignedIntType) VersionConvertor_10_30.convertType(src.getQuantityElement())); } if (src.hasCharacteristic()) { for (org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); @@ -80,8 +81,8 @@ public class Group10_30 { if (src.hasValue()) { tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); } - if (src.hasExclude()) { - tgt.setExclude(src.getExclude()); + if (src.hasExcludeElement()) { + tgt.setExcludeElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getExcludeElement())); } if (src.hasPeriod()) { tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); @@ -100,8 +101,8 @@ public class Group10_30 { if (src.hasValue()) { tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); } - if (src.hasExclude()) { - tgt.setExclude(src.getExclude()); + if (src.hasExcludeElement()) { + tgt.setExcludeElement((BooleanType) VersionConvertor_10_30.convertType(src.getExcludeElement())); } if (src.hasPeriod()) { tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); @@ -120,8 +121,8 @@ public class Group10_30 { if (src.hasPeriod()) { tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); } - if (src.hasInactive()) { - tgt.setInactive(src.getInactive()); + if (src.hasInactiveElement()) { + tgt.setInactiveElement((BooleanType) VersionConvertor_10_30.convertType(src.getInactiveElement())); } return tgt; } @@ -137,8 +138,8 @@ public class Group10_30 { if (src.hasPeriod()) { tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); } - if (src.hasInactive()) { - tgt.setInactive(src.getInactive()); + if (src.hasInactiveElement()) { + tgt.setInactiveElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getInactiveElement())); } 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 78b6d55f8..06bb7e843 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class HealthcareService10_30 { @@ -70,12 +72,10 @@ public class HealthcareService10_30 { 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.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); + if (src.hasExtraDetailsElement()) + tgt.setExtraDetailsElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getExtraDetailsElement())); if (src.hasPhoto()) { tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); } @@ -91,9 +91,8 @@ public class HealthcareService10_30 { if (src.hasEligibility()) { tgt.setEligibility(VersionConvertor_10_30.convertCodeableConcept(src.getEligibility())); } - if (src.hasEligibilityNote()) { - tgt.setEligibilityNote(src.getEligibilityNote()); - } + if (src.hasEligibilityNoteElement()) + tgt.setEligibilityNoteElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getEligibilityNoteElement())); if (src.hasProgramName()) { for (org.hl7.fhir.dstu3.model.StringType t : src.getProgramName()) tgt.addProgramName(t.getValue()); } @@ -103,8 +102,8 @@ public class HealthcareService10_30 { 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.hasAppointmentRequiredElement()) { + tgt.setAppointmentRequiredElement((BooleanType) VersionConvertor_10_30.convertType(src.getAppointmentRequiredElement())); } if (src.hasAvailableTime()) { for (org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); @@ -112,9 +111,8 @@ public class HealthcareService10_30 { 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()); - } + if (src.hasAvailabilityExceptionsElement()) + tgt.setAvailabilityExceptionsElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getAvailabilityExceptionsElement())); return tgt; } @@ -135,12 +133,10 @@ public class HealthcareService10_30 { 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.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); + if (src.hasExtraDetailsElement()) + tgt.setExtraDetailsElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getExtraDetailsElement())); if (src.hasPhoto()) { tgt.setPhoto(VersionConvertor_10_30.convertAttachment(src.getPhoto())); } @@ -156,9 +152,8 @@ public class HealthcareService10_30 { if (src.hasEligibility()) { tgt.setEligibility(VersionConvertor_10_30.convertCodeableConcept(src.getEligibility())); } - if (src.hasEligibilityNote()) { - tgt.setEligibilityNote(src.getEligibilityNote()); - } + if (src.hasEligibilityNoteElement()) + tgt.setEligibilityNoteElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getEligibilityNoteElement())); if (src.hasProgramName()) { for (org.hl7.fhir.dstu2.model.StringType t : src.getProgramName()) tgt.addProgramName(t.getValue()); } @@ -168,8 +163,8 @@ public class HealthcareService10_30 { 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.hasAppointmentRequiredElement()) { + tgt.setAppointmentRequiredElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getAppointmentRequiredElement())); } if (src.hasAvailableTime()) { for (org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); @@ -177,9 +172,8 @@ public class HealthcareService10_30 { 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()); - } + if (src.hasAvailabilityExceptionsElement()) + tgt.setAvailabilityExceptionsElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getAvailabilityExceptionsElement())); return tgt; } @@ -191,15 +185,13 @@ public class HealthcareService10_30 { 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()); + if (src.hasAllDayElement()) { + tgt.setAllDayElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getAllDayElement())); } + if (src.hasAvailableStartTimeElement()) + tgt.setAvailableStartTimeElement((org.hl7.fhir.dstu3.model.TimeType) VersionConvertor_10_30.convertType(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTimeElement()) + tgt.setAvailableEndTimeElement((org.hl7.fhir.dstu3.model.TimeType) VersionConvertor_10_30.convertType(src.getAvailableEndTimeElement())); return tgt; } @@ -211,15 +203,13 @@ public class HealthcareService10_30 { 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()); + if (src.hasAllDayElement()) { + tgt.setAllDayElement((BooleanType) VersionConvertor_10_30.convertType(src.getAllDayElement())); } + if (src.hasAvailableStartTimeElement()) + tgt.setAvailableStartTimeElement((org.hl7.fhir.dstu2.model.TimeType) VersionConvertor_10_30.convertType(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTimeElement()) + tgt.setAvailableEndTimeElement((org.hl7.fhir.dstu2.model.TimeType) VersionConvertor_10_30.convertType(src.getAvailableEndTimeElement())); return tgt; } @@ -228,9 +218,8 @@ 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); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasDuring()) { tgt.setDuring(VersionConvertor_10_30.convertPeriod(src.getDuring())); } @@ -242,9 +231,8 @@ 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); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasDuring()) { tgt.setDuring(VersionConvertor_10_30.convertPeriod(src.getDuring())); } 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 ec5bd3ab6..20a340aaf 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.UnsignedIntType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class ImagingStudy10_30 { @@ -10,9 +12,8 @@ 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); - if (src.hasUid()) { - tgt.setUid(src.getUid()); - } + if (src.hasUidElement()) + tgt.setUidElement((org.hl7.fhir.dstu3.model.OidType) VersionConvertor_10_30.convertType(src.getUidElement())); if (src.hasAccession()) { tgt.setAccession(VersionConvertor_10_30.convertIdentifier(src.getAccession())); } @@ -28,27 +29,25 @@ public class ImagingStudy10_30 { if (src.hasPatient()) { tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); } - if (src.hasStarted()) { - tgt.setStarted(src.getStarted()); - } + if (src.hasStartedElement()) + tgt.setStartedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getStartedElement())); 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.hasNumberOfSeriesElement()) { + tgt.setNumberOfSeriesElement((UnsignedIntType) VersionConvertor_10_30.convertType(src.getNumberOfSeriesElement())); } - if (src.hasNumberOfInstances()) { - tgt.setNumberOfInstances(src.getNumberOfInstances()); + if (src.hasNumberOfInstancesElement()) { + tgt.setNumberOfInstancesElement((UnsignedIntType) VersionConvertor_10_30.convertType(src.getNumberOfInstancesElement())); } 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasSeries()) { for (org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) tgt.addSeries(convertImagingStudySeriesComponent(t)); } @@ -60,9 +59,8 @@ 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); - if (src.hasUid()) { - tgt.setUid(src.getUid()); - } + if (src.hasUidElement()) + tgt.setUidElement((org.hl7.fhir.dstu2.model.OidType) VersionConvertor_10_30.convertType(src.getUidElement())); if (src.hasAccession()) { tgt.setAccession(VersionConvertor_10_30.convertIdentifier(src.getAccession())); } @@ -78,27 +76,25 @@ public class ImagingStudy10_30 { if (src.hasPatient()) { tgt.setPatient(VersionConvertor_10_30.convertReference(src.getPatient())); } - if (src.hasStarted()) { - tgt.setStarted(src.getStarted()); - } + if (src.hasStartedElement()) + tgt.setStartedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getStartedElement())); 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.hasNumberOfSeriesElement()) { + tgt.setNumberOfSeriesElement((org.hl7.fhir.dstu2.model.UnsignedIntType) VersionConvertor_10_30.convertType(src.getNumberOfSeriesElement())); } - if (src.hasNumberOfInstances()) { - tgt.setNumberOfInstances(src.getNumberOfInstances()); + if (src.hasNumberOfInstancesElement()) { + tgt.setNumberOfInstancesElement((org.hl7.fhir.dstu2.model.UnsignedIntType) VersionConvertor_10_30.convertType(src.getNumberOfInstancesElement())); } 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasSeries()) { for (org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) tgt.addSeries(convertImagingStudySeriesComponent(t)); } @@ -110,18 +106,16 @@ 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); - if (src.hasUid()) { - tgt.setUid(src.getUid()); - } + if (src.hasUidElement()) + tgt.setUidElement((org.hl7.fhir.dstu2.model.OidType) VersionConvertor_10_30.convertType(src.getUidElement())); 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasNumberOfInstances()) { tgt.setNumberOfInstances(src.getNumberOfInstances()); } @@ -134,9 +128,8 @@ public class ImagingStudy10_30 { if (src.hasLaterality()) { tgt.setLaterality(VersionConvertor_10_30.convertCoding(src.getLaterality())); } - if (src.hasStarted()) { - tgt.setStarted(src.getStarted()); - } + if (src.hasStartedElement()) + tgt.setStartedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getStartedElement())); if (src.hasInstance()) { for (org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); } @@ -148,18 +141,16 @@ 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); - if (src.hasUid()) { - tgt.setUid(src.getUid()); - } + if (src.hasUidElement()) + tgt.setUidElement((org.hl7.fhir.dstu3.model.OidType) VersionConvertor_10_30.convertType(src.getUidElement())); 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasNumberOfInstances()) { tgt.setNumberOfInstances(src.getNumberOfInstances()); } @@ -172,9 +163,8 @@ public class ImagingStudy10_30 { if (src.hasLaterality()) { tgt.setLaterality(VersionConvertor_10_30.convertCoding(src.getLaterality())); } - if (src.hasStarted()) { - tgt.setStarted(src.getStarted()); - } + if (src.hasStartedElement()) + tgt.setStartedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getStartedElement())); if (src.hasInstance()) { for (org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); } @@ -186,18 +176,15 @@ 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); - 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()); + if (src.hasUidElement()) + tgt.setUidElement((org.hl7.fhir.dstu3.model.OidType) VersionConvertor_10_30.convertType(src.getUidElement())); + if (src.hasNumberElement()) { + tgt.setNumberElement((UnsignedIntType) VersionConvertor_10_30.convertType(src.getNumberElement())); } + if (src.hasSopClassElement()) + tgt.setSopClassElement((org.hl7.fhir.dstu3.model.OidType) VersionConvertor_10_30.convertType(src.getSopClassElement())); + if (src.hasTitleElement()) + tgt.setTitleElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTitleElement())); return tgt; } @@ -206,18 +193,15 @@ 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); - 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()); + if (src.hasUidElement()) + tgt.setUidElement((org.hl7.fhir.dstu2.model.OidType) VersionConvertor_10_30.convertType(src.getUidElement())); + if (src.hasNumberElement()) { + tgt.setNumberElement((org.hl7.fhir.dstu2.model.UnsignedIntType) VersionConvertor_10_30.convertType(src.getNumberElement())); } + if (src.hasSopClassElement()) + tgt.setSopClassElement((org.hl7.fhir.dstu2.model.OidType) VersionConvertor_10_30.convertType(src.getSopClassElement())); + if (src.hasTitleElement()) + tgt.setTitleElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTitleElement())); 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 77381ff89..883941660 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 @@ -1,10 +1,12 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; 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; +import java.util.Collections; public class Immunization10_30 { @@ -19,16 +21,16 @@ public class Immunization10_30 { if (src.hasStatus()) { tgt.setStatus(src.getStatus().toCode()); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); 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.hasNotGivenElement()) { + tgt.setWasNotGivenElement((BooleanType) VersionConvertor_10_30.convertType(src.getNotGivenElement())); } if (src.hasPrimarySource()) { tgt.setReported(!src.getPrimarySource()); @@ -48,12 +50,10 @@ public class Immunization10_30 { 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.hasLotNumberElement()) + tgt.setLotNumberElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getLotNumberElement())); + if (src.hasExpirationDateElement()) + tgt.setExpirationDateElement((org.hl7.fhir.dstu2.model.DateType) VersionConvertor_10_30.convertType(src.getExpirationDateElement())); if (src.hasSite()) { tgt.setSite(VersionConvertor_10_30.convertCodeableConcept(src.getSite())); } @@ -93,16 +93,16 @@ public class Immunization10_30 { } catch (org.hl7.fhir.exceptions.FHIRException e) { throw new FHIRException(e); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); 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.hasWasNotGivenElement()) { + tgt.setNotGivenElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getWasNotGivenElement())); } if (src.hasReported()) { tgt.setPrimarySource(!src.getReported()); @@ -120,12 +120,10 @@ public class Immunization10_30 { 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.hasLotNumberElement()) + tgt.setLotNumberElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getLotNumberElement())); + if (src.hasExpirationDateElement()) + tgt.setExpirationDateElement((org.hl7.fhir.dstu3.model.DateType) VersionConvertor_10_30.convertType(src.getExpirationDateElement())); if (src.hasSite()) { tgt.setSite(VersionConvertor_10_30.convertCodeableConcept(src.getSite())); } @@ -183,13 +181,13 @@ public class Immunization10_30 { return null; org.hl7.fhir.dstu3.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.dstu3.model.Immunization.ImmunizationReactionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasDetail()) { tgt.setDetail(VersionConvertor_10_30.convertReference(src.getDetail())); } - if (src.hasReported()) { - tgt.setReported(src.getReported()); + if (src.hasReportedElement()) { + tgt.setReportedElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getReportedElement())); } return tgt; } @@ -199,13 +197,13 @@ public class Immunization10_30 { return null; org.hl7.fhir.dstu2.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.dstu2.model.Immunization.ImmunizationReactionComponent(); VersionConvertor_10_30.copyElement(src, tgt); - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasDetail()) { tgt.setDetail(VersionConvertor_10_30.convertReference(src.getDetail())); } - if (src.hasReported()) { - tgt.setReported(src.getReported()); + if (src.hasReportedElement()) { + tgt.setReportedElement((BooleanType) VersionConvertor_10_30.convertType(src.getReportedElement())); } return tgt; } @@ -218,15 +216,13 @@ public class Immunization10_30 { if (src.hasDoseSequence()) { tgt.setDoseSequence(src.getDoseSequence()); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasAuthority()) { tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); } - if (src.hasSeries()) { - tgt.setSeries(src.getSeries()); - } + if (src.hasSeriesElement()) + tgt.setSeriesElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getSeriesElement())); if (src.hasSeriesDoses()) { tgt.setSeriesDoses(src.getSeriesDoses()); } @@ -250,15 +246,13 @@ public class Immunization10_30 { if (src.hasDoseSequence()) { tgt.setDoseSequence(src.getDoseSequence()); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasAuthority()) { tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); } - if (src.hasSeries()) { - tgt.setSeries(src.getSeries()); - } + if (src.hasSeriesElement()) + tgt.setSeriesElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getSeriesElement())); if (src.hasSeriesDoses()) { tgt.setSeriesDoses(src.getSeriesDoses()); } 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 17722ecd7..cf063a4fd 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.PositiveIntType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class ImmunizationRecommendation10_30 { @@ -44,13 +46,13 @@ public class ImmunizationRecommendation10_30 { return null; org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.dstu2.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasVaccineCode()) { tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); } - if (src.hasDoseNumber()) { - tgt.setDoseNumber(src.getDoseNumber()); + if (src.hasDoseNumberElement()) { + tgt.setDoseNumberElement((PositiveIntType) VersionConvertor_10_30.convertType(src.getDoseNumberElement())); } if (src.hasForecastStatus()) { tgt.setForecastStatus(VersionConvertor_10_30.convertCodeableConcept(src.getForecastStatus())); @@ -75,13 +77,13 @@ public class ImmunizationRecommendation10_30 { return null; org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent(); VersionConvertor_10_30.copyElement(src, tgt); - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasVaccineCode()) { tgt.setVaccineCode(VersionConvertor_10_30.convertCodeableConcept(src.getVaccineCode())); } - if (src.hasDoseNumber()) { - tgt.setDoseNumber(src.getDoseNumber()); + if (src.hasDoseNumberElement()) { + tgt.setDoseNumberElement((org.hl7.fhir.dstu3.model.PositiveIntType) VersionConvertor_10_30.convertType(src.getDoseNumberElement())); } if (src.hasForecastStatus()) { tgt.setForecastStatus(VersionConvertor_10_30.convertCodeableConcept(src.getForecastStatus())); @@ -109,9 +111,8 @@ public class ImmunizationRecommendation10_30 { if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getValueElement())); return tgt; } @@ -123,9 +124,8 @@ public class ImmunizationRecommendation10_30 { if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getValueElement())); return tgt; } @@ -137,15 +137,13 @@ public class ImmunizationRecommendation10_30 { if (src.hasDoseSequence()) { tgt.setDoseSequence(src.getDoseSequence()); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasAuthority()) { tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); } - if (src.hasSeries()) { - tgt.setSeries(src.getSeries()); - } + if (src.hasSeriesElement()) + tgt.setSeriesElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getSeriesElement())); return tgt; } @@ -157,15 +155,13 @@ public class ImmunizationRecommendation10_30 { if (src.hasDoseSequence()) { tgt.setDoseSequence(src.getDoseSequence()); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasAuthority()) { tgt.setAuthority(VersionConvertor_10_30.convertReference(src.getAuthority())); } - if (src.hasSeries()) { - tgt.setSeries(src.getSeries()); - } + if (src.hasSeriesElement()) + tgt.setSeriesElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getSeriesElement())); 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 df04a482b..20795eb4a 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 @@ -1,7 +1,10 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; +import java.util.stream.Collectors; public class ImplementationGuide10_30 { @@ -86,41 +89,34 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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()); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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)); - if (src.hasCopyright()) { - tgt.setCopyright(src.getCopyright()); - } - if (src.hasFhirVersion()) { - tgt.setFhirVersion(src.getFhirVersion()); - } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); + if (src.hasFhirVersionElement()) + tgt.setFhirVersionElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getFhirVersionElement())); if (src.hasDependency()) { for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); } @@ -131,7 +127,9 @@ public class ImplementationGuide10_30 { 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()); + tgt.setBinary(src.getBinary().stream() + .map(binary -> (org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(binary)) + .collect(Collectors.toList())); } if (src.hasPage()) { tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); @@ -144,42 +142,35 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); 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.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); + if (src.hasFhirVersionElement()) + tgt.setFhirVersionElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getFhirVersionElement())); if (src.hasDependency()) { for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) tgt.addDependency(convertImplementationGuideDependencyComponent(t)); } @@ -203,9 +194,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -217,9 +207,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -234,9 +223,8 @@ public class ImplementationGuide10_30 { if (src.hasType()) { tgt.setType(convertGuideDependencyType(src.getType())); } - if (src.hasUri()) { - tgt.setUri(src.getUri()); - } + if (src.hasUriElement()) + tgt.setUriElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUriElement())); return tgt; } @@ -248,9 +236,8 @@ public class ImplementationGuide10_30 { if (src.hasType()) { tgt.setType(convertGuideDependencyType(src.getType())); } - if (src.hasUri()) { - tgt.setUri(src.getUri()); - } + if (src.hasUriElement()) + tgt.setUriElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUriElement())); return tgt; } @@ -259,9 +246,8 @@ 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); - if (src.hasType()) { - tgt.setType(src.getType()); - } + if (src.hasTypeElement()) + tgt.setTypeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getTypeElement())); if (src.hasProfile()) { tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); } @@ -273,9 +259,8 @@ 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); - if (src.hasType()) { - tgt.setType(src.getType()); - } + if (src.hasTypeElement()) + tgt.setTypeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getTypeElement())); if (src.hasProfile()) { tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); } @@ -287,12 +272,10 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasResource()) { for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); } @@ -304,12 +287,10 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasResource()) { for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); } @@ -324,15 +305,12 @@ public class ImplementationGuide10_30 { 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.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasAcronymElement()) + tgt.setAcronymElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getAcronymElement())); if (src.hasSource()) { tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); } @@ -351,15 +329,12 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } - if (src.hasAcronym()) { - tgt.setAcronym(src.getAcronym()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasAcronymElement()) + tgt.setAcronymElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getAcronymElement())); if (src.hasSource()) { tgt.setSource(VersionConvertor_10_30.convertType(src.getSource())); } @@ -374,9 +349,8 @@ 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); - if (src.hasSource()) { - tgt.setSource(src.getSource()); - } + if (src.hasSourceElement()) + tgt.setSourceElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getSourceElement())); if (src.hasTitle()) { tgt.setName(src.getTitle()); } @@ -389,9 +363,8 @@ public class ImplementationGuide10_30 { 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.hasFormatElement()) + tgt.setFormatElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getFormatElement())); if (src.hasPage()) { for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); } @@ -403,9 +376,8 @@ 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); - if (src.hasSource()) { - tgt.setSource(src.getSource()); - } + if (src.hasSourceElement()) + tgt.setSourceElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getSourceElement())); if (src.hasName()) { tgt.setTitle(src.getName()); } @@ -418,9 +390,8 @@ public class ImplementationGuide10_30 { 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.hasFormatElement()) + tgt.setFormatElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getFormatElement())); if (src.hasPage()) { for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) tgt.addPage(convertImplementationGuidePageComponent(t)); } 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 5e315b227..44c577abc 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 @@ -1,7 +1,10 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.DateTimeType; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class List10_30 { @@ -31,8 +34,8 @@ public class List10_30 { if (src.hasStatus()) { tgt.setStatus(convertListStatus(src.getStatus())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasOrderedBy()) { tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); } @@ -74,8 +77,8 @@ public class List10_30 { if (src.hasStatus()) { tgt.setStatus(convertListStatus(src.getStatus())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasOrderedBy()) { tgt.setOrderedBy(VersionConvertor_10_30.convertCodeableConcept(src.getOrderedBy())); } @@ -98,11 +101,11 @@ public class List10_30 { if (src.hasFlag()) { tgt.setFlag(VersionConvertor_10_30.convertCodeableConcept(src.getFlag())); } - if (src.hasDeleted()) { - tgt.setDeleted(src.getDeleted()); + if (src.hasDeletedElement()) { + tgt.setDeletedElement((BooleanType) VersionConvertor_10_30.convertType(src.getDeletedElement())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasItem()) { tgt.setItem(VersionConvertor_10_30.convertReference(src.getItem())); } @@ -117,11 +120,11 @@ public class List10_30 { if (src.hasFlag()) { tgt.setFlag(VersionConvertor_10_30.convertCodeableConcept(src.getFlag())); } - if (src.hasDeleted()) { - tgt.setDeleted(src.getDeleted()); + if (src.hasDeletedElement()) { + tgt.setDeletedElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getDeletedElement())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); if (src.hasItem()) { tgt.setItem(VersionConvertor_10_30.convertReference(src.getItem())); } 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 a57ec696d..c7aa08b7f 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.DecimalType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Location10_30 { @@ -16,12 +18,10 @@ public class Location10_30 { if (src.hasStatus()) { tgt.setStatus(convertLocationStatus(src.getStatus())); } - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasMode()) { tgt.setMode(convertLocationMode(src.getMode())); } @@ -60,12 +60,10 @@ public class Location10_30 { if (src.hasStatus()) { tgt.setStatus(convertLocationStatus(src.getStatus())); } - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasMode()) { tgt.setMode(convertLocationMode(src.getMode())); } @@ -124,14 +122,14 @@ 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); - if (src.hasLongitude()) { - tgt.setLongitude(src.getLongitude()); + if (src.hasLongitudeElement()) { + tgt.setLongitudeElement((DecimalType) VersionConvertor_10_30.convertType(src.getLongitudeElement())); } - if (src.hasLatitude()) { - tgt.setLatitude(src.getLatitude()); + if (src.hasLatitudeElement()) { + tgt.setLatitudeElement((DecimalType) VersionConvertor_10_30.convertType(src.getLatitudeElement())); } - if (src.hasAltitude()) { - tgt.setAltitude(src.getAltitude()); + if (src.hasAltitudeElement()) { + tgt.setAltitudeElement((DecimalType) VersionConvertor_10_30.convertType(src.getAltitudeElement())); } return tgt; } @@ -141,14 +139,14 @@ 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); - if (src.hasLongitude()) { - tgt.setLongitude(src.getLongitude()); + if (src.hasLongitudeElement()) { + tgt.setLongitudeElement((org.hl7.fhir.dstu2.model.DecimalType) VersionConvertor_10_30.convertType(src.getLongitudeElement())); } - if (src.hasLatitude()) { - tgt.setLatitude(src.getLatitude()); + if (src.hasLatitudeElement()) { + tgt.setLatitudeElement((org.hl7.fhir.dstu2.model.DecimalType) VersionConvertor_10_30.convertType(src.getLatitudeElement())); } - if (src.hasAltitude()) { - tgt.setAltitude(src.getAltitude()); + if (src.hasAltitudeElement()) { + tgt.setAltitudeElement((org.hl7.fhir.dstu2.model.DecimalType) VersionConvertor_10_30.convertType(src.getAltitudeElement())); } 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 901a5d741..a78cff347 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 @@ -1,7 +1,10 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.PositiveIntType; +import org.hl7.fhir.dstu2.model.UnsignedIntType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Media10_30 { @@ -61,17 +64,17 @@ public class Media10_30 { if (src.hasDevice()) { tgt.setDeviceName(src.getDevice().getDisplay()); } - if (src.hasHeight()) { - tgt.setHeight(src.getHeight()); + if (src.hasHeightElement()) { + tgt.setHeightElement((PositiveIntType) VersionConvertor_10_30.convertType(src.getHeightElement())); } - if (src.hasWidth()) { - tgt.setWidth(src.getWidth()); + if (src.hasWidthElement()) { + tgt.setWidthElement((PositiveIntType) VersionConvertor_10_30.convertType(src.getWidthElement())); } - if (src.hasFrames()) { - tgt.setFrames(src.getFrames()); + if (src.hasFramesElement()) { + tgt.setFramesElement((PositiveIntType) VersionConvertor_10_30.convertType(src.getFramesElement())); } - if (src.hasDuration()) { - tgt.setDuration(src.getDuration()); + if (src.hasDurationElement()) { + tgt.setDurationElement((UnsignedIntType) VersionConvertor_10_30.convertType(src.getDurationElement())); } if (src.hasContent()) { tgt.setContent(VersionConvertor_10_30.convertAttachment(src.getContent())); @@ -105,17 +108,17 @@ public class Media10_30 { if (src.hasDeviceName()) { tgt.getDevice().setDisplay(src.getDeviceName()); } - if (src.hasHeight()) { - tgt.setHeight(src.getHeight()); + if (src.hasHeightElement()) { + tgt.setHeightElement((org.hl7.fhir.dstu3.model.PositiveIntType) VersionConvertor_10_30.convertType(src.getHeightElement())); } - if (src.hasWidth()) { - tgt.setWidth(src.getWidth()); + if (src.hasWidthElement()) { + tgt.setWidthElement((org.hl7.fhir.dstu3.model.PositiveIntType) VersionConvertor_10_30.convertType(src.getWidthElement())); } - if (src.hasFrames()) { - tgt.setFrames(src.getFrames()); + if (src.hasFramesElement()) { + tgt.setFramesElement((org.hl7.fhir.dstu3.model.PositiveIntType) VersionConvertor_10_30.convertType(src.getFramesElement())); } - if (src.hasDuration()) { - tgt.setDuration(src.getDuration()); + if (src.hasDurationElement()) { + tgt.setDurationElement((org.hl7.fhir.dstu3.model.UnsignedIntType) VersionConvertor_10_30.convertType(src.getDurationElement())); } if (src.hasContent()) { tgt.setContent(VersionConvertor_10_30.convertAttachment(src.getContent())); 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 f5a89b295..ec06a2498 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Medication10_30 { @@ -13,8 +15,8 @@ public class Medication10_30 { if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } - if (src.hasIsBrand()) { - tgt.setIsBrand(src.getIsBrand()); + if (src.hasIsBrandElement()) { + tgt.setIsBrandElement((BooleanType) VersionConvertor_10_30.convertType(src.getIsBrandElement())); } if (src.hasManufacturer()) { tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); @@ -33,8 +35,8 @@ public class Medication10_30 { if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } - if (src.hasIsBrand()) { - tgt.setIsBrand(src.getIsBrand()); + if (src.hasIsBrandElement()) { + tgt.setIsBrandElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getIsBrandElement())); } if (src.hasManufacturer()) { tgt.setManufacturer(VersionConvertor_10_30.convertReference(src.getManufacturer())); 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 ab2cda095..bbe4cac50 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 @@ -3,6 +3,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.dstu3.model.Dosage; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class MedicationDispense10_30 { @@ -35,20 +36,18 @@ public class MedicationDispense10_30 { 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.hasWhenPreparedElement()) + tgt.setWhenPreparedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getWhenPreparedElement())); + if (src.hasWhenHandedOverElement()) + tgt.setWhenHandedOverElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getWhenHandedOverElement())); 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()); + if (src.hasNoteElement()) + tgt.setNote(Collections.singletonList((org.hl7.fhir.dstu3.model.Annotation) VersionConvertor_10_30.convertType(src.getNoteElement()))); if (src.hasDosageInstruction()) { for (org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent t : src.getDosageInstruction()) tgt.addDosageInstruction(convertMedicationDispenseDosageInstructionComponent(t)); } @@ -87,12 +86,10 @@ public class MedicationDispense10_30 { 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.hasWhenPreparedElement()) + tgt.setWhenPreparedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getWhenPreparedElement())); + if (src.hasWhenHandedOverElement()) + tgt.setWhenHandedOverElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getWhenHandedOverElement())); if (src.hasDestination()) { tgt.setDestination(VersionConvertor_10_30.convertReference(src.getDestination())); } 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 8776ed443..6269f1345 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.StringType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class MedicationStatement10_30 { @@ -31,13 +33,13 @@ public class MedicationStatement10_30 { 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()); + if (src.hasDateAssertedElement()) + tgt.setDateAssertedElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateAssertedElement())); 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()); + if (src.hasNoteElement()) + tgt.setNote(Collections.singletonList((org.hl7.fhir.dstu3.model.Annotation) VersionConvertor_10_30.convertType(src.getNoteElement()))); if (src.hasDosage()) { for (org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementDosageComponent t : src.getDosage()) tgt.addDosage(convertMedicationStatementDosageComponent(t)); } @@ -70,8 +72,8 @@ public class MedicationStatement10_30 { 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()); + if (src.hasDateAssertedElement()) + tgt.setDateAssertedElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateAssertedElement())); if (src.hasReasonNotTaken()) { for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonNotTaken()) tgt.addReasonNotTaken(VersionConvertor_10_30.convertCodeableConcept(t)); } @@ -89,8 +91,8 @@ 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); - if (src.hasText()) { - tgt.setText(src.getText()); + if (src.hasTextElement()) { + tgt.setTextElement((StringType) VersionConvertor_10_30.convertType(src.getTextElement())); } if (src.hasTiming()) { tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); @@ -120,8 +122,8 @@ 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); - if (src.hasText()) { - tgt.setText(src.getText()); + if (src.hasTextElement()) { + tgt.setTextElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); } if (src.hasTiming()) { tgt.setTiming(VersionConvertor_10_30.convertTiming(src.getTiming())); 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 77ee37f57..8caf888ff 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class MessageHeader10_30 { @@ -10,15 +11,13 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTarget()) { tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); } - if (src.hasEndpoint()) { - tgt.setEndpoint(src.getEndpoint()); - } + if (src.hasEndpointElement()) + tgt.setEndpointElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getEndpointElement())); return tgt; } @@ -27,15 +26,13 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTarget()) { tgt.setTarget(VersionConvertor_10_30.convertReference(src.getTarget())); } - if (src.hasEndpoint()) { - tgt.setEndpoint(src.getEndpoint()); - } + if (src.hasEndpointElement()) + tgt.setEndpointElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getEndpointElement())); return tgt; } @@ -44,9 +41,8 @@ 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); - if (src.hasTimestamp()) { - tgt.setTimestamp(src.getTimestamp()); - } + if (src.hasTimestampElement()) + tgt.setTimestampElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getTimestampElement())); if (src.hasEvent()) { tgt.setEvent(VersionConvertor_10_30.convertCoding(src.getEvent())); } @@ -85,9 +81,8 @@ 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); - if (src.hasTimestamp()) { - tgt.setTimestamp(src.getTimestamp()); - } + if (src.hasTimestampElement()) + tgt.setTimestampElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getTimestampElement())); if (src.hasEvent()) { tgt.setEvent(VersionConvertor_10_30.convertCoding(src.getEvent())); } @@ -126,9 +121,8 @@ 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); - if (src.hasIdentifier()) { - tgt.setIdentifier(src.getIdentifier()); - } + if (src.hasIdentifierElement()) + tgt.setIdentifierElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getIdentifierElement())); if (src.hasCode()) { tgt.setCode(convertResponseType(src.getCode())); } @@ -143,9 +137,8 @@ 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); - if (src.hasIdentifier()) { - tgt.setIdentifier(src.getIdentifier()); - } + if (src.hasIdentifierElement()) + tgt.setIdentifierElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getIdentifierElement())); if (src.hasCode()) { tgt.setCode(convertResponseType(src.getCode())); } @@ -160,21 +153,17 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasSoftware()) { - tgt.setSoftware(src.getSoftware()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasSoftwareElement()) + tgt.setSoftwareElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getSoftwareElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); if (src.hasContact()) { tgt.setContact(VersionConvertor_10_30.convertContactPoint(src.getContact())); } - if (src.hasEndpoint()) { - tgt.setEndpoint(src.getEndpoint()); - } + if (src.hasEndpointElement()) + tgt.setEndpointElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getEndpointElement())); return tgt; } @@ -183,21 +172,17 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasSoftware()) { - tgt.setSoftware(src.getSoftware()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasSoftwareElement()) + tgt.setSoftwareElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getSoftwareElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); if (src.hasContact()) { tgt.setContact(VersionConvertor_10_30.convertContactPoint(src.getContact())); } - if (src.hasEndpoint()) { - tgt.setEndpoint(src.getEndpoint()); - } + if (src.hasEndpointElement()) + tgt.setEndpointElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getEndpointElement())); 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 ec8191ac3..67a860593 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class NamingSystem10_30 { @@ -10,39 +12,34 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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.hasResponsibleElement()) + tgt.setResponsibleElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getResponsibleElement())); if (src.hasType()) { tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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)); - if (src.hasUsage()) { - tgt.setUsage(src.getUsage()); - } + if (src.hasUsageElement()) + tgt.setUsageElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getUsageElement())); if (src.hasUniqueId()) { for (org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); } @@ -57,40 +54,35 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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.hasResponsibleElement()) + tgt.setResponsibleElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getResponsibleElement())); if (src.hasType()) { tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); 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.hasUsageElement()) + tgt.setUsageElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getUsageElement())); if (src.hasUniqueId()) { for (org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); } @@ -105,9 +97,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -119,9 +110,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -200,11 +190,10 @@ public class NamingSystem10_30 { if (src.hasType()) { tgt.setType(convertNamingSystemIdentifierType(src.getType())); } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } - if (src.hasPreferred()) { - tgt.setPreferred(src.getPreferred()); + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getValueElement())); + if (src.hasPreferredElement()) { + tgt.setPreferredElement((BooleanType) VersionConvertor_10_30.convertType(src.getPreferredElement())); } if (src.hasPeriod()) { tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); @@ -220,11 +209,10 @@ public class NamingSystem10_30 { if (src.hasType()) { tgt.setType(convertNamingSystemIdentifierType(src.getType())); } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } - if (src.hasPreferred()) { - tgt.setPreferred(src.getPreferred()); + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getValueElement())); + if (src.hasPreferredElement()) { + tgt.setPreferredElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getPreferredElement())); } if (src.hasPeriod()) { tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); 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 de472505e..5e0f51acc 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.StringType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Observation10_30 { @@ -31,9 +33,8 @@ public class Observation10_30 { if (src.hasEffective()) { tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); } - if (src.hasIssued()) { - tgt.setIssued(src.getIssued()); - } + if (src.hasIssuedElement()) + tgt.setIssuedElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getIssuedElement())); if (src.hasPerformer()) { for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); } @@ -46,8 +47,8 @@ public class Observation10_30 { if (src.hasInterpretation()) { tgt.setInterpretation(VersionConvertor_10_30.convertCodeableConcept(src.getInterpretation())); } - if (src.hasComments()) { - tgt.setComment(src.getComments()); + if (src.hasCommentsElement()) { + tgt.setCommentElement((StringType) VersionConvertor_10_30.convertType(src.getCommentsElement())); } if (src.hasBodySite()) { tgt.setBodySite(VersionConvertor_10_30.convertCodeableConcept(src.getBodySite())); @@ -99,9 +100,8 @@ public class Observation10_30 { if (src.hasEffective()) { tgt.setEffective(VersionConvertor_10_30.convertType(src.getEffective())); } - if (src.hasIssued()) { - tgt.setIssued(src.getIssued()); - } + if (src.hasIssuedElement()) + tgt.setIssuedElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getIssuedElement())); if (src.hasPerformer()) { for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(VersionConvertor_10_30.convertReference(t)); } @@ -114,8 +114,8 @@ public class Observation10_30 { if (src.hasInterpretation()) { tgt.setInterpretation(VersionConvertor_10_30.convertCodeableConcept(src.getInterpretation())); } - if (src.hasComment()) { - tgt.setComments(src.getComment()); + if (src.hasCommentElement()) { + tgt.setCommentsElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); } if (src.hasBodySite()) { tgt.setBodySite(VersionConvertor_10_30.convertCodeableConcept(src.getBodySite())); @@ -198,9 +198,8 @@ public class Observation10_30 { if (src.hasAge()) { tgt.setAge(VersionConvertor_10_30.convertRange(src.getAge())); } - if (src.hasText()) { - tgt.setText(src.getText()); - } + if (src.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); return tgt; } @@ -221,9 +220,8 @@ public class Observation10_30 { if (src.hasAge()) { tgt.setAge(VersionConvertor_10_30.convertRange(src.getAge())); } - if (src.hasText()) { - tgt.setText(src.getText()); - } + if (src.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); 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 c234ece13..d16abcb72 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 @@ -1,9 +1,14 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; +import org.hl7.fhir.dstu2.model.IntegerType; +import org.hl7.fhir.dstu2.model.StringType; import org.hl7.fhir.dstu3.model.Enumerations.SearchParamType; +import org.hl7.fhir.dstu3.model.MarkdownType; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.Utilities; +import java.util.Collections; public class OperationDefinition10_30 { @@ -12,45 +17,39 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasPurpose()) { tgt.setRequirements(src.getPurpose()); } - if (src.hasIdempotent()) { - tgt.setIdempotent(src.getIdempotent()); + if (src.hasIdempotentElement()) { + tgt.setIdempotentElement((BooleanType) VersionConvertor_10_30.convertType(src.getIdempotentElement())); } - if (src.hasCode()) { - tgt.setCode(src.getCode()); - } - if (src.hasComment()) { - tgt.setNotes(src.getComment()); + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); + if (src.hasCommentElement()) { + tgt.setNotesElement((StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); } if (src.hasBase()) tgt.setBase(VersionConvertor_10_30.convertReference(src.getBase())); @@ -75,44 +74,38 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasRequirementsElement()) { + tgt.setPurposeElement((MarkdownType) VersionConvertor_10_30.convertType(src.getRequirementsElement())); } - if (src.hasRequirements()) { - tgt.setPurpose(src.getRequirements()); - } - if (src.hasIdempotent()) - tgt.setIdempotent(src.getIdempotent()); - if (src.hasCode()) { - tgt.setCode(src.getCode()); - } - if (src.hasNotes()) { - tgt.setComment(src.getNotes()); + if (src.hasIdempotentElement()) + tgt.setIdempotentElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getIdempotentElement())); + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); + if (src.hasNotesElement()) { + tgt.setCommentElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNotesElement())); } if (src.hasBase()) { tgt.setBase(VersionConvertor_10_30.convertReference(src.getBase())); @@ -138,9 +131,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -152,9 +144,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -194,26 +185,20 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - } else { - tgt.setType(src.getType()); + if (src.hasMinElement()) { + tgt.setMinElement((IntegerType) VersionConvertor_10_30.convertType(src.getMinElement())); } + if (src.hasMaxElement()) + tgt.setMaxElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getMaxElement())); + if (src.hasDocumentationElement()) + tgt.setDocumentationElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); + if (src.hasTypeElement()) + tgt.setTypeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getTypeElement())); if (src.hasProfile()) tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); if (src.hasBinding()) @@ -229,31 +214,20 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getNameElement())); 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"); - if (src.hasType()) { - tgt.setSearchType(SearchParamType.fromCode(src.getType())); - } - } else { - if (src.hasType()) { - tgt.setType(src.getType()); - } + if (src.hasMinElement()) { + tgt.setMinElement((org.hl7.fhir.dstu3.model.IntegerType) VersionConvertor_10_30.convertType(src.getMinElement())); } + if (src.hasMaxElement()) + tgt.setMaxElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getMaxElement())); + if (src.hasDocumentationElement()) + tgt.setDocumentationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDocumentationElement())); + if (Utilities.existsInList(src.getType(), "token", "reference", "composite", "number", "date", "quantity", "uri")) + tgt.setTypeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getTypeElement())); if (src.hasProfile()) { tgt.setProfile(VersionConvertor_10_30.convertReference(src.getProfile())); } 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 c5d661e49..68dcf8d0b 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class OperationOutcome10_30 { @@ -209,9 +210,8 @@ public class OperationOutcome10_30 { if (src.hasDetails()) { tgt.setDetails(VersionConvertor_10_30.convertCodeableConcept(src.getDetails())); } - if (src.hasDiagnostics()) { - tgt.setDiagnostics(src.getDiagnostics()); - } + if (src.hasDiagnosticsElement()) + tgt.setDiagnosticsElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDiagnosticsElement())); if (src.hasLocation()) { for (org.hl7.fhir.dstu2.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); } @@ -232,9 +232,8 @@ public class OperationOutcome10_30 { if (src.hasDetails()) { tgt.setDetails(VersionConvertor_10_30.convertCodeableConcept(src.getDetails())); } - if (src.hasDiagnostics()) { - tgt.setDiagnostics(src.getDiagnostics()); - } + if (src.hasDiagnosticsElement()) + tgt.setDiagnosticsElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDiagnosticsElement())); if (src.hasLocation()) { for (org.hl7.fhir.dstu3.model.StringType t : src.getLocation()) tgt.addLocation(t.getValue()); } 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 3c9882804..56f842ce8 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Organization10_30 { @@ -13,15 +15,14 @@ public class Organization10_30 { 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.hasActiveElement()) { + tgt.setActiveElement((BooleanType) VersionConvertor_10_30.convertType(src.getActiveElement())); } if (src.hasType()) { tgt.addType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -45,15 +46,14 @@ public class Organization10_30 { 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.hasActiveElement()) { + tgt.setActiveElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getActiveElement())); } if (src.hasType()) { tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getTypeFirstRep())); } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } 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 c9b755ab7..9fcb4facc 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Parameters10_30 { @@ -32,9 +33,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasValue()) { tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); } @@ -52,9 +52,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasValue()) { tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); } 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 124d89338..f2ad6b863 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Patient10_30 { @@ -149,9 +151,8 @@ public class Patient10_30 { if (src.hasGender()) { tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); } - if (src.hasBirthDate()) { - tgt.setBirthDate(src.getBirthDate()); - } + if (src.hasBirthDateElement()) + tgt.setBirthDateElement((org.hl7.fhir.dstu3.model.DateType) VersionConvertor_10_30.convertType(src.getBirthDateElement())); if (src.hasDeceased()) { tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); } @@ -208,9 +209,8 @@ public class Patient10_30 { if (src.hasGender()) { tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); } - if (src.hasBirthDate()) { - tgt.setBirthDate(src.getBirthDate()); - } + if (src.hasBirthDateElement()) + tgt.setBirthDateElement((org.hl7.fhir.dstu2.model.DateType) VersionConvertor_10_30.convertType(src.getBirthDateElement())); if (src.hasDeceased()) { tgt.setDeceased(VersionConvertor_10_30.convertType(src.getDeceased())); } @@ -255,8 +255,8 @@ public class Patient10_30 { if (src.hasLanguage()) { tgt.setLanguage(VersionConvertor_10_30.convertCodeableConcept(src.getLanguage())); } - if (src.hasPreferred()) { - tgt.setPreferred(src.getPreferred()); + if (src.hasPreferredElement()) { + tgt.setPreferredElement((BooleanType) VersionConvertor_10_30.convertType(src.getPreferredElement())); } return tgt; } @@ -269,8 +269,8 @@ public class Patient10_30 { if (src.hasLanguage()) { tgt.setLanguage(VersionConvertor_10_30.convertCodeableConcept(src.getLanguage())); } - if (src.hasPreferred()) { - tgt.setPreferred(src.getPreferred()); + if (src.hasPreferredElement()) { + tgt.setPreferredElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getPreferredElement())); } 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 b34cf94d4..0ee9fc66f 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Person10_30 { @@ -56,9 +58,8 @@ public class Person10_30 { if (src.hasGender()) { tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); } - if (src.hasBirthDate()) { - tgt.setBirthDate(src.getBirthDate()); - } + if (src.hasBirthDateElement()) + tgt.setBirthDateElement((org.hl7.fhir.dstu3.model.DateType) VersionConvertor_10_30.convertType(src.getBirthDateElement())); if (src.hasAddress()) { for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); } @@ -68,8 +69,8 @@ public class Person10_30 { if (src.hasManagingOrganization()) { tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); } - if (src.hasActive()) { - tgt.setActive(src.getActive()); + if (src.hasActiveElement()) { + tgt.setActiveElement((BooleanType) VersionConvertor_10_30.convertType(src.getActiveElement())); } if (src.hasLink()) { for (org.hl7.fhir.dstu2.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); @@ -94,9 +95,8 @@ public class Person10_30 { if (src.hasGender()) { tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); } - if (src.hasBirthDate()) { - tgt.setBirthDate(src.getBirthDate()); - } + if (src.hasBirthDateElement()) + tgt.setBirthDateElement((org.hl7.fhir.dstu2.model.DateType) VersionConvertor_10_30.convertType(src.getBirthDateElement())); if (src.hasAddress()) { for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); } @@ -106,8 +106,8 @@ public class Person10_30 { if (src.hasManagingOrganization()) { tgt.setManagingOrganization(VersionConvertor_10_30.convertReference(src.getManagingOrganization())); } - if (src.hasActive()) { - tgt.setActive(src.getActive()); + if (src.hasActiveElement()) { + tgt.setActiveElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getActiveElement())); } if (src.hasLink()) { for (org.hl7.fhir.dstu3.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); 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 4a44a6916..354fe85c8 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Practitioner10_30 { @@ -13,8 +15,8 @@ public class Practitioner10_30 { 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.hasActiveElement()) { + tgt.setActiveElement((BooleanType) VersionConvertor_10_30.convertType(src.getActiveElement())); } if (src.hasName()) tgt.addName(VersionConvertor_10_30.convertHumanName(src.getName())); @@ -27,9 +29,8 @@ public class Practitioner10_30 { if (src.hasGender()) { tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); } - if (src.hasBirthDate()) { - tgt.setBirthDate(src.getBirthDate()); - } + if (src.hasBirthDateElement()) + tgt.setBirthDateElement((org.hl7.fhir.dstu3.model.DateType) VersionConvertor_10_30.convertType(src.getBirthDateElement())); if (src.hasPhoto()) { for (org.hl7.fhir.dstu2.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); } @@ -50,8 +51,8 @@ public class Practitioner10_30 { 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.hasActiveElement()) { + tgt.setActiveElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getActiveElement())); } if (src.hasName()) { for (org.hl7.fhir.dstu3.model.HumanName t : src.getName()) tgt.setName(VersionConvertor_10_30.convertHumanName(t)); @@ -65,9 +66,8 @@ public class Practitioner10_30 { if (src.hasGender()) { tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); } - if (src.hasBirthDate()) { - tgt.setBirthDate(src.getBirthDate()); - } + if (src.hasBirthDateElement()) + tgt.setBirthDateElement((org.hl7.fhir.dstu2.model.DateType) VersionConvertor_10_30.convertType(src.getBirthDateElement())); if (src.hasPhoto()) { for (org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto()) tgt.addPhoto(VersionConvertor_10_30.convertAttachment(t)); } 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 d542bcea2..f16c6bd05 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Procedure10_30 { @@ -25,8 +27,8 @@ public class Procedure10_30 { if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } - if (src.hasNotDone()) { - tgt.setNotPerformed(src.getNotDone()); + if (src.hasNotDoneElement()) { + tgt.setNotPerformedElement((BooleanType) VersionConvertor_10_30.convertType(src.getNotDoneElement())); } if (src.hasNotDoneReason()) { tgt.addReasonNotPerformed(VersionConvertor_10_30.convertCodeableConcept(src.getNotDoneReason())); @@ -90,8 +92,8 @@ public class Procedure10_30 { if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } - if (src.hasNotPerformed()) { - tgt.setNotDone(src.getNotPerformed()); + if (src.hasNotPerformedElement()) { + tgt.setNotDoneElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getNotPerformedElement())); } if (src.hasReasonNotPerformed()) tgt.setNotDoneReason(VersionConvertor_10_30.convertCodeableConcept(src.getReasonNotPerformed().get(0))); 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 610c383f4..8a2c79369 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class ProcedureRequest10_30 { 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 1e8a2ecc2..450a68fd0 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Provenance10_30 { @@ -16,9 +17,8 @@ public class Provenance10_30 { if (src.hasPeriod()) { tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); } - if (src.hasRecorded()) { - tgt.setRecorded(src.getRecorded()); - } + if (src.hasRecordedElement()) + tgt.setRecordedElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getRecordedElement())); if (src.hasReason()) { for (org.hl7.fhir.dstu3.model.Coding t : src.getReason()) tgt.addReason().addCoding(VersionConvertor_10_30.convertCoding(t)); } @@ -54,9 +54,8 @@ public class Provenance10_30 { if (src.hasPeriod()) { tgt.setPeriod(VersionConvertor_10_30.convertPeriod(src.getPeriod())); } - if (src.hasRecorded()) { - tgt.setRecorded(src.getRecorded()); - } + if (src.hasRecordedElement()) + tgt.setRecordedElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getRecordedElement())); 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)); } 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 7d9b80a67..023502bde 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 @@ -1,8 +1,11 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; +import org.hl7.fhir.dstu2.model.StringType; import org.hl7.fhir.dstu3.model.ContactDetail; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Questionnaire10_30 { @@ -14,23 +17,21 @@ public class Questionnaire10_30 { 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.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); if (src.hasStatus()) { tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); } - if (src.hasDate()) - tgt.setDate(src.getDate()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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(); - if (src.hasTitle()) { - root.setTitle(src.getTitle()); + if (src.hasTitleElement()) { + root.setTitleElement((StringType) VersionConvertor_10_30.convertType(src.getTitleElement())); } for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) { root.addConcept(VersionConvertor_10_30.convertCoding(t)); @@ -53,12 +54,12 @@ public class Questionnaire10_30 { for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(VersionConvertor_10_30.convertIdentifier(t)); tgt.setVersion(src.getVersion()); tgt.setStatus(convertQuestionnaireStatus(src.getStatus())); - if (src.hasDate()) - tgt.setDate(src.getDate()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); tgt.setPublisher(src.getPublisher()); for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addContact(convertQuestionnaireContactComponent(t)); org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent root = src.getGroup(); - tgt.setTitle(root.getTitle()); + tgt.setTitleElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(root.getTitleElement())); for (org.hl7.fhir.dstu2.model.Coding t : root.getConcept()) tgt.addCode(VersionConvertor_10_30.convertCoding(t)); for (org.hl7.fhir.dstu2.model.CodeType t : src.getSubjectType()) tgt.addSubjectType(t.getValue()); tgt.addItem(convertQuestionnaireGroupComponent(root)); @@ -79,20 +80,18 @@ 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); - if (src.hasLinkId()) { - tgt.setLinkId(src.getLinkId()); - } + if (src.hasLinkIdElement()) + tgt.setLinkIdElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getLinkIdElement())); 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.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); + if (src.hasRequiredElement()) { + tgt.setRequiredElement((BooleanType) VersionConvertor_10_30.convertType(src.getRequiredElement())); } - if (src.hasRequired()) { - tgt.setRequired(src.getRequired()); - } - if (src.hasRepeats()) { - tgt.setRepeats(src.getRepeats()); + if (src.hasRepeatsElement()) { + tgt.setRepeatsElement((BooleanType) VersionConvertor_10_30.convertType(src.getRepeatsElement())); } 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)); @@ -106,21 +105,19 @@ 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); - if (src.hasLinkId()) { - tgt.setLinkId(src.getLinkId()); - } + if (src.hasLinkIdElement()) + tgt.setLinkIdElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getLinkIdElement())); 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.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); tgt.setType(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemType.GROUP); - if (src.hasRequired()) { - tgt.setRequired(src.getRequired()); + if (src.hasRequiredElement()) { + tgt.setRequiredElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getRequiredElement())); } - if (src.hasRepeats()) { - tgt.setRepeats(src.getRepeats()); + if (src.hasRepeatsElement()) { + tgt.setRepeatsElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getRepeatsElement())); } if (src.hasGroup()) { for (org.hl7.fhir.dstu2.model.Questionnaire.GroupComponent t : src.getGroup()) tgt.addItem(convertQuestionnaireGroupComponent(t)); @@ -173,23 +170,21 @@ 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); - if (src.hasLinkId()) { - tgt.setLinkId(src.getLinkId()); - } + if (src.hasLinkIdElement()) + tgt.setLinkIdElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getLinkIdElement())); 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.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); if (src.hasType()) { tgt.setType(convertQuestionnaireQuestionType(src.getType())); } - if (src.hasRequired()) { - tgt.setRequired(src.getRequired()); + if (src.hasRequiredElement()) { + tgt.setRequiredElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getRequiredElement())); } - if (src.hasRepeats()) { - tgt.setRepeats(src.getRepeats()); + if (src.hasRepeatsElement()) { + tgt.setRepeatsElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getRepeatsElement())); } if (src.hasOptions()) { tgt.setOptions(VersionConvertor_10_30.convertReference(src.getOptions())); @@ -208,23 +203,21 @@ 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); - if (src.hasLinkId()) { - tgt.setLinkId(src.getLinkId()); - } + if (src.hasLinkIdElement()) + tgt.setLinkIdElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getLinkIdElement())); 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.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); if (src.hasType()) { tgt.setType(convertQuestionnaireItemType(src.getType())); } - if (src.hasRequired()) { - tgt.setRequired(src.getRequired()); + if (src.hasRequiredElement()) { + tgt.setRequiredElement((BooleanType) VersionConvertor_10_30.convertType(src.getRequiredElement())); } - if (src.hasRepeats()) { - tgt.setRepeats(src.getRepeats()); + if (src.hasRepeatsElement()) { + tgt.setRepeatsElement((BooleanType) VersionConvertor_10_30.convertType(src.getRepeatsElement())); } if (src.hasOptions()) { tgt.setOptions(VersionConvertor_10_30.convertReference(src.getOptions())); 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 abc3b2acf..97efc1de5 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class QuestionnaireResponse10_30 { @@ -10,12 +11,10 @@ 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); - if (src.hasLinkId()) { - tgt.setLinkId(src.getLinkId()); - } - if (src.hasText()) { - tgt.setText(src.getText()); - } + if (src.hasLinkIdElement()) + tgt.setLinkIdElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getLinkIdElement())); + if (src.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); if (src.hasSubject()) { tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); } @@ -31,12 +30,10 @@ 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); - if (src.hasLinkId()) { - tgt.setLinkId(src.getLinkId()); - } - if (src.hasText()) { - tgt.setText(src.getText()); - } + if (src.hasLinkIdElement()) + tgt.setLinkIdElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getLinkIdElement())); + if (src.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); if (src.hasAnswer()) { for (org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); } @@ -63,9 +60,8 @@ public class QuestionnaireResponse10_30 { if (src.hasAuthor()) { tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); } - if (src.hasAuthored()) { - tgt.setAuthored(src.getAuthored()); - } + if (src.hasAuthoredElement()) + tgt.setAuthoredElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getAuthoredElement())); if (src.hasSource()) { tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); } @@ -100,9 +96,8 @@ public class QuestionnaireResponse10_30 { if (src.hasAuthor()) { tgt.setAuthor(VersionConvertor_10_30.convertReference(src.getAuthor())); } - if (src.hasAuthored()) { - tgt.setAuthored(src.getAuthored()); - } + if (src.hasAuthoredElement()) + tgt.setAuthoredElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getAuthoredElement())); if (src.hasSource()) { tgt.setSource(VersionConvertor_10_30.convertReference(src.getSource())); } @@ -119,12 +114,10 @@ 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); - if (src.hasLinkId()) { - tgt.setLinkId(src.getLinkId()); - } - if (src.hasText()) { - tgt.setText(src.getText()); - } + if (src.hasLinkIdElement()) + tgt.setLinkIdElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getLinkIdElement())); + if (src.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); if (src.hasSubject()) { tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); } @@ -170,12 +163,10 @@ 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); - if (src.hasLinkId()) { - tgt.setLinkId(src.getLinkId()); - } - if (src.hasText()) { - tgt.setText(src.getText()); - } + if (src.hasLinkIdElement()) + tgt.setLinkIdElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getLinkIdElement())); + if (src.hasTextElement()) + tgt.setTextElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getTextElement())); if (src.hasAnswer()) { for (org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionAnswerComponent t : src.getAnswer()) tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); } 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 ccf9ef230..cf69b8224 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 @@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.dstu2.model.CodeableConcept; import org.hl7.fhir.dstu3.model.ReferralRequest.ReferralPriority; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class ReferralRequest10_30 { @@ -77,9 +78,8 @@ public class ReferralRequest10_30 { 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasServiceRequested()) { for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceRequested()) tgt.addServiceRequested(VersionConvertor_10_30.convertCodeableConcept(t)); } @@ -124,9 +124,8 @@ public class ReferralRequest10_30 { if (src.hasReason()) { tgt.addReasonCode(VersionConvertor_10_30.convertCodeableConcept(src.getReason())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasServiceRequested()) { for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getServiceRequested()) tgt.addServiceRequested(VersionConvertor_10_30.convertCodeableConcept(t)); } 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 5c1a5111b..ded4f545b 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class RelatedPerson10_30 { @@ -28,9 +29,8 @@ public class RelatedPerson10_30 { if (src.hasGender()) { tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); } - if (src.hasBirthDate()) { - tgt.setBirthDate(src.getBirthDate()); - } + if (src.hasBirthDateElement()) + tgt.setBirthDateElement((org.hl7.fhir.dstu3.model.DateType) VersionConvertor_10_30.convertType(src.getBirthDateElement())); if (src.hasAddress()) { for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); } @@ -65,9 +65,8 @@ public class RelatedPerson10_30 { if (src.hasGender()) { tgt.setGender(VersionConvertor_10_30.convertAdministrativeGender(src.getGender())); } - if (src.hasBirthDate()) { - tgt.setBirthDate(src.getBirthDate()); - } + if (src.hasBirthDateElement()) + tgt.setBirthDateElement((org.hl7.fhir.dstu2.model.DateType) VersionConvertor_10_30.convertType(src.getBirthDateElement())); if (src.hasAddress()) { for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(VersionConvertor_10_30.convertAddress(t)); } 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 e39099f20..625cec9c9 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.DecimalType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class RiskAssessment10_30 { @@ -34,9 +36,8 @@ public class RiskAssessment10_30 { 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.hasMitigationElement()) + tgt.setMitigationElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getMitigationElement())); return tgt; } @@ -69,9 +70,8 @@ public class RiskAssessment10_30 { 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()); - } + if (src.hasMitigationElement()) + tgt.setMitigationElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getMitigationElement())); return tgt; } @@ -86,15 +86,14 @@ public class RiskAssessment10_30 { if (src.hasProbability()) { tgt.setProbability(VersionConvertor_10_30.convertType(src.getProbability())); } - if (src.hasRelativeRisk()) { - tgt.setRelativeRisk(src.getRelativeRisk()); + if (src.hasRelativeRiskElement()) { + tgt.setRelativeRiskElement((DecimalType) VersionConvertor_10_30.convertType(src.getRelativeRiskElement())); } if (src.hasWhen()) { tgt.setWhen(VersionConvertor_10_30.convertType(src.getWhen())); } - if (src.hasRationale()) { - tgt.setRationale(src.getRationale()); - } + if (src.hasRationaleElement()) + tgt.setRationaleElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getRationaleElement())); return tgt; } @@ -109,15 +108,14 @@ public class RiskAssessment10_30 { if (src.hasProbability()) { tgt.setProbability(VersionConvertor_10_30.convertType(src.getProbability())); } - if (src.hasRelativeRisk()) { - tgt.setRelativeRisk(src.getRelativeRisk()); + if (src.hasRelativeRiskElement()) { + tgt.setRelativeRiskElement((org.hl7.fhir.dstu2.model.DecimalType) VersionConvertor_10_30.convertType(src.getRelativeRiskElement())); } if (src.hasWhen()) { tgt.setWhen(VersionConvertor_10_30.convertType(src.getWhen())); } - if (src.hasRationale()) { - tgt.setRationale(src.getRationale()); - } + if (src.hasRationaleElement()) + tgt.setRationaleElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getRationaleElement())); 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 e4e773f10..9d857c534 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Schedule10_30 { @@ -22,9 +23,8 @@ public class Schedule10_30 { if (src.hasPlanningHorizon()) { tgt.setPlanningHorizon(VersionConvertor_10_30.convertPeriod(src.getPlanningHorizon())); } - if (src.hasComment()) { - tgt.setComment(src.getComment()); - } + if (src.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); return tgt; } @@ -45,9 +45,8 @@ public class Schedule10_30 { if (src.hasPlanningHorizon()) { tgt.setPlanningHorizon(VersionConvertor_10_30.convertPeriod(src.getPlanningHorizon())); } - if (src.hasComment()) { - tgt.setComment(src.getComment()); - } + if (src.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); 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 657a49a7a..ac4b52910 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 @@ -1,8 +1,12 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; +import org.hl7.fhir.dstu2.model.StringType; import org.hl7.fhir.dstu2.utils.ToolingExtensions; +import org.hl7.fhir.dstu3.model.MarkdownType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class SearchParameter10_30 { @@ -11,46 +15,40 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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.hasPurposeElement()) { + tgt.setRequirementsElement((StringType) VersionConvertor_10_30.convertType(src.getPurposeElement())); } + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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.hasXpathElement()) + tgt.setXpathElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getXpathElement())); if (src.hasXpathUsage()) { tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); } @@ -65,44 +63,37 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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.hasRequirementsElement()) { + tgt.setPurposeElement((MarkdownType) VersionConvertor_10_30.convertType(src.getRequirementsElement())); } + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); + if (src.hasBaseElement()) + tgt.setBase(Collections.singletonList((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getBaseElement()))); if (src.hasType()) { tgt.setType(VersionConvertor_10_30.convertSearchParamType(src.getType())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); tgt.setExpression(ToolingExtensions.readStringExtension(src, ToolingExtensions.EXT_EXPRESSION)); - if (src.hasXpath()) { - tgt.setXpath(src.getXpath()); - } + if (src.hasXpathElement()) + tgt.setXpathElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getXpathElement())); if (src.hasXpathUsage()) { tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage())); } @@ -117,9 +108,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -131,9 +121,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } 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 e78870166..07c6aa4f7 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 @@ -1,7 +1,9 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu3.model.BooleanType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Slot10_30 { @@ -18,18 +20,15 @@ public class Slot10_30 { 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()); + if (src.hasStartElement()) + tgt.setStartElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getStartElement())); + if (src.hasEndElement()) + tgt.setEndElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getEndElement())); + if (src.hasOverbookedElement()) { + tgt.setOverbookedElement((BooleanType) VersionConvertor_10_30.convertType(src.getOverbookedElement())); } + if (src.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); return tgt; } @@ -47,18 +46,15 @@ public class Slot10_30 { 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()); + if (src.hasStartElement()) + tgt.setStartElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getStartElement())); + if (src.hasEndElement()) + tgt.setEndElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getEndElement())); + if (src.hasOverbookedElement()) { + tgt.setOverbookedElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getOverbookedElement())); } + if (src.hasCommentElement()) + tgt.setCommentElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); 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 98bac12fe..6c13ca50f 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Specimen10_30 { @@ -22,8 +23,8 @@ public class Specimen10_30 { tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); if (src.hasSubject()) tgt.setSubject(VersionConvertor_10_30.convertReference(src.getSubject())); - if (src.hasReceivedTime()) - tgt.setReceivedTime(src.getReceivedTime()); + if (src.hasReceivedTimeElement()) + tgt.setReceivedTimeElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getReceivedTimeElement())); if (src.hasParent()) { for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addParent(VersionConvertor_10_30.convertReference(t)); } @@ -64,8 +65,8 @@ public class Specimen10_30 { 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.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasType()) tgt.setType(VersionConvertor_10_30.convertCodeableConcept(src.getType())); if (src.hasCapacity()) @@ -82,8 +83,8 @@ public class Specimen10_30 { return null; org.hl7.fhir.dstu2.model.Specimen.SpecimenTreatmentComponent tgt = new org.hl7.fhir.dstu2.model.Specimen.SpecimenTreatmentComponent(); VersionConvertor_10_30.copyElement(src, tgt); - if (src.hasDescription()) - tgt.setDescription(src.getDescription()); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasProcedure()) tgt.setProcedure(VersionConvertor_10_30.convertCodeableConcept(src.getProcedure())); if (src.hasAdditive()) { 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 2bcad832b..c3f2ad464 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 @@ -1,12 +1,17 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; +import org.hl7.fhir.dstu2.model.StringType; +import org.hl7.fhir.dstu2.model.UriType; +import org.hl7.fhir.dstu3.model.MarkdownType; 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; +import java.util.Collections; public class StructureDefinition10_30 { @@ -45,62 +50,55 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); 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.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasTitleElement()) { + tgt.setDisplayElement((StringType) VersionConvertor_10_30.convertType(src.getTitleElement())); } if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); 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.hasPurposeElement()) { + tgt.setRequirementsElement((StringType) VersionConvertor_10_30.convertType(src.getPurposeElement())); } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); 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.hasFhirVersionElement()) + tgt.setFhirVersionElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getFhirVersionElement())); 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.hasAbstractElement()) { + tgt.setAbstractElement((BooleanType) VersionConvertor_10_30.convertType(src.getAbstractElement())); } if (src.hasContextType()) { tgt.setContextType(convertExtensionContext(src.getContextType())); @@ -111,8 +109,8 @@ public class StructureDefinition10_30 { if (src.hasType()) { tgt.setConstrainedType(src.getType()); } - if (src.hasBaseDefinition()) { - tgt.setBase(src.getBaseDefinition()); + if (src.hasBaseDefinitionElement()) { + tgt.setBaseElement((UriType) VersionConvertor_10_30.convertType(src.getBaseDefinitionElement())); } if (src.hasSnapshot()) { tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); @@ -134,61 +132,54 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); 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.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDisplayElement()) { + tgt.setTitleElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDisplayElement())); } if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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()); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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)); - if (src.hasRequirements()) { - tgt.setPurpose(src.getRequirements()); - } - if (src.hasCopyright()) { - tgt.setCopyright(src.getCopyright()); + if (src.hasRequirementsElement()) { + tgt.setPurposeElement((MarkdownType) VersionConvertor_10_30.convertType(src.getRequirementsElement())); } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); 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.hasFhirVersionElement()) + tgt.setFhirVersionElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getFhirVersionElement())); 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.hasAbstractElement()) { + tgt.setAbstractElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getAbstractElement())); } if (src.hasContextType()) { tgt.setContextType(convertExtensionContext(src.getContextType())); @@ -231,9 +222,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -245,9 +235,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -319,17 +308,14 @@ 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); - 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()); + if (src.hasIdentityElement()) + tgt.setIdentityElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getIdentityElement())); + if (src.hasUriElement()) + tgt.setUriElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUriElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasCommentElement()) { + tgt.setCommentsElement((StringType) VersionConvertor_10_30.convertType(src.getCommentElement())); } return tgt; } @@ -339,17 +325,14 @@ 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); - 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()); + if (src.hasIdentityElement()) + tgt.setIdentityElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getIdentityElement())); + if (src.hasUriElement()) + tgt.setUriElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUriElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasCommentsElement()) { + tgt.setCommentElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCommentsElement())); } 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 ada80c4cf..b751a5f8c 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Subscription10_30 { @@ -10,27 +11,23 @@ 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); - if (src.hasCriteria()) { - tgt.setCriteria(src.getCriteria()); - } + if (src.hasCriteriaElement()) + tgt.setCriteriaElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCriteriaElement())); 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.hasReasonElement()) + tgt.setReasonElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getReasonElement())); if (src.hasStatus()) { tgt.setStatus(convertSubscriptionStatus(src.getStatus())); } - if (src.hasError()) { - tgt.setError(src.getError()); - } + if (src.hasErrorElement()) + tgt.setErrorElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getErrorElement())); if (src.hasChannel()) { tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); } - if (src.hasEnd()) { - tgt.setEnd(src.getEnd()); - } + if (src.hasEndElement()) + tgt.setEndElement((org.hl7.fhir.dstu3.model.InstantType) VersionConvertor_10_30.convertType(src.getEndElement())); if (src.hasTag()) { for (org.hl7.fhir.dstu2.model.Coding t : src.getTag()) tgt.addTag(VersionConvertor_10_30.convertCoding(t)); } @@ -42,27 +39,23 @@ 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); - if (src.hasCriteria()) { - tgt.setCriteria(src.getCriteria()); - } + if (src.hasCriteriaElement()) + tgt.setCriteriaElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCriteriaElement())); 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.hasReasonElement()) + tgt.setReasonElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getReasonElement())); if (src.hasStatus()) { tgt.setStatus(convertSubscriptionStatus(src.getStatus())); } - if (src.hasError()) { - tgt.setError(src.getError()); - } + if (src.hasErrorElement()) + tgt.setErrorElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getErrorElement())); if (src.hasChannel()) { tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel())); } - if (src.hasEnd()) { - tgt.setEnd(src.getEnd()); - } + if (src.hasEndElement()) + tgt.setEndElement((org.hl7.fhir.dstu2.model.InstantType) VersionConvertor_10_30.convertType(src.getEndElement())); if (src.hasTag()) { for (org.hl7.fhir.dstu3.model.Coding t : src.getTag()) tgt.addTag(VersionConvertor_10_30.convertCoding(t)); } @@ -77,12 +70,10 @@ public class Subscription10_30 { if (src.hasType()) { tgt.setType(convertSubscriptionChannelType(src.getType())); } - if (src.hasEndpoint()) { - tgt.setEndpoint(src.getEndpoint()); - } - if (src.hasPayload()) { - tgt.setPayload(src.getPayload()); - } + if (src.hasEndpointElement()) + tgt.setEndpointElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getEndpointElement())); + if (src.hasPayloadElement()) + tgt.setPayloadElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPayloadElement())); if (src.hasHeader()) tgt.setHeaderElement(VersionConvertor_10_30.convertString(src.getHeader().get(0))); return tgt; @@ -96,15 +87,12 @@ public class Subscription10_30 { 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()); - } + if (src.hasEndpointElement()) + tgt.setEndpointElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getEndpointElement())); + if (src.hasPayloadElement()) + tgt.setPayloadElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPayloadElement())); + if (src.hasHeaderElement()) + tgt.setHeader(Collections.singletonList((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getHeaderElement()))); 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 7a4d195c7..ebc3a493a 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class Substance10_30 { @@ -19,9 +20,8 @@ public class Substance10_30 { if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasInstance()) { for (org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); } @@ -45,9 +45,8 @@ public class Substance10_30 { if (src.hasCode()) { tgt.setCode(VersionConvertor_10_30.convertCodeableConcept(src.getCode())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasInstance()) { for (org.hl7.fhir.dstu2.model.Substance.SubstanceInstanceComponent t : src.getInstance()) tgt.addInstance(convertSubstanceInstanceComponent(t)); } @@ -90,9 +89,8 @@ public class Substance10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasExpiry()) { - tgt.setExpiry(src.getExpiry()); - } + if (src.hasExpiryElement()) + tgt.setExpiryElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getExpiryElement())); if (src.hasQuantity()) { tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); } @@ -107,9 +105,8 @@ public class Substance10_30 { if (src.hasIdentifier()) { tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(src.getIdentifier())); } - if (src.hasExpiry()) { - tgt.setExpiry(src.getExpiry()); - } + if (src.hasExpiryElement()) + tgt.setExpiryElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getExpiryElement())); if (src.hasQuantity()) { tgt.setQuantity(VersionConvertor_10_30.convertSimpleQuantity(src.getQuantity())); } 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 d3832c0f9..d42ef2d3d 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 @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class SupplyDelivery10_30 { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SupplyRequest10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SupplyRequest10_30.java index 01c88f3e1..20dd8a6db 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SupplyRequest10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/SupplyRequest10_30.java @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class SupplyRequest10_30 { 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 50e200bd3..22a892f92 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 @@ -1,7 +1,13 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertor_10_30; +import org.hl7.fhir.dstu2.model.BooleanType; +import org.hl7.fhir.dstu2.model.IdType; +import org.hl7.fhir.dstu2.model.IntegerType; +import org.hl7.fhir.dstu2.model.StringType; +import org.hl7.fhir.dstu3.model.MarkdownType; import org.hl7.fhir.exceptions.FHIRException; +import java.util.Collections; public class TestScript10_30 { @@ -186,57 +192,45 @@ 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); - if (src.hasLabel()) { - tgt.setLabel(src.getLabel()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasLabelElement()) + tgt.setLabelElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getLabelElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasDirection()) { tgt.setDirection(convertAssertionDirectionType(src.getDirection())); } - if (src.hasCompareToSourceId()) { - tgt.setCompareToSourceId(src.getCompareToSourceId()); - } - if (src.hasCompareToSourcePath()) { - tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - } + if (src.hasCompareToSourceIdElement()) + tgt.setCompareToSourceIdElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCompareToSourceIdElement())); + if (src.hasCompareToSourcePathElement()) + tgt.setCompareToSourcePathElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getCompareToSourcePathElement())); if (src.hasContentType()) { tgt.setContentType(convertContentType(src.getContentType())); } - if (src.hasHeaderField()) { - tgt.setHeaderField(src.getHeaderField()); - } - if (src.hasMinimumId()) { - tgt.setMinimumId(src.getMinimumId()); - } + if (src.hasHeaderFieldElement()) + tgt.setHeaderFieldElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getHeaderFieldElement())); + if (src.hasMinimumIdElement()) + tgt.setMinimumIdElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getMinimumIdElement())); 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.hasPathElement()) + tgt.setPathElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPathElement())); + if (src.hasResourceElement()) + tgt.setResourceElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getResourceElement())); 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.hasResponseCodeElement()) + tgt.setResponseCodeElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getResponseCodeElement())); + if (src.hasSourceIdElement()) + tgt.setSourceIdElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getSourceIdElement())); + if (src.hasValidateProfileIdElement()) + tgt.setValidateProfileIdElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getValidateProfileIdElement())); + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getValueElement())); if (src.hasWarningOnly()) { tgt.setWarningOnly(src.getWarningOnly()); } @@ -248,57 +242,45 @@ 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); - if (src.hasLabel()) { - tgt.setLabel(src.getLabel()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasLabelElement()) + tgt.setLabelElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getLabelElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasDirection()) { tgt.setDirection(convertAssertionDirectionType(src.getDirection())); } - if (src.hasCompareToSourceId()) { - tgt.setCompareToSourceId(src.getCompareToSourceId()); - } - if (src.hasCompareToSourcePath()) { - tgt.setCompareToSourcePath(src.getCompareToSourcePath()); - } + if (src.hasCompareToSourceIdElement()) + tgt.setCompareToSourceIdElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCompareToSourceIdElement())); + if (src.hasCompareToSourcePathElement()) + tgt.setCompareToSourcePathElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCompareToSourcePathElement())); if (src.hasContentType()) { tgt.setContentType(convertContentType(src.getContentType())); } - if (src.hasHeaderField()) { - tgt.setHeaderField(src.getHeaderField()); - } - if (src.hasMinimumId()) { - tgt.setMinimumId(src.getMinimumId()); - } + if (src.hasHeaderFieldElement()) + tgt.setHeaderFieldElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getHeaderFieldElement())); + if (src.hasMinimumIdElement()) + tgt.setMinimumIdElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getMinimumIdElement())); 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.hasPathElement()) + tgt.setPathElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPathElement())); + if (src.hasResourceElement()) + tgt.setResourceElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getResourceElement())); 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.hasResponseCodeElement()) + tgt.setResponseCodeElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getResponseCodeElement())); + if (src.hasSourceIdElement()) + tgt.setSourceIdElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getSourceIdElement())); + if (src.hasValidateProfileIdElement()) + tgt.setValidateProfileIdElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getValidateProfileIdElement())); + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getValueElement())); if (src.hasWarningOnly()) { tgt.setWarningOnly(src.getWarningOnly()); } @@ -341,45 +323,38 @@ public class TestScript10_30 { 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.hasResourceElement()) + tgt.setResourceElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getResourceElement())); + if (src.hasLabelElement()) + tgt.setLabelElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getLabelElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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.hasDestinationElement()) { + tgt.setDestinationElement((IntegerType) VersionConvertor_10_30.convertType(src.getDestinationElement())); } - if (src.hasEncodeRequestUrl()) { - tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); - } - if (src.hasParams()) { - tgt.setParams(src.getParams()); + if (src.hasEncodeRequestUrlElement()) { + tgt.setEncodeRequestUrlElement((BooleanType) VersionConvertor_10_30.convertType(src.getEncodeRequestUrlElement())); } + if (src.hasParamsElement()) + tgt.setParamsElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getParamsElement())); 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()); + if (src.hasResponseIdElement()) + tgt.setResponseIdElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getResponseIdElement())); + if (src.hasSourceIdElement()) + tgt.setSourceIdElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getSourceIdElement())); + if (src.hasTargetIdElement()) { + tgt.setTargetIdElement((IdType) VersionConvertor_10_30.convertType(src.getTargetIdElement())); } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getUrlElement())); return tgt; } @@ -391,45 +366,38 @@ public class TestScript10_30 { 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.hasResourceElement()) + tgt.setResourceElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getResourceElement())); + if (src.hasLabelElement()) + tgt.setLabelElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getLabelElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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.hasDestinationElement()) { + tgt.setDestinationElement((org.hl7.fhir.dstu3.model.IntegerType) VersionConvertor_10_30.convertType(src.getDestinationElement())); } - if (src.hasEncodeRequestUrl()) { - tgt.setEncodeRequestUrl(src.getEncodeRequestUrl()); - } - if (src.hasParams()) { - tgt.setParams(src.getParams()); + if (src.hasEncodeRequestUrlElement()) { + tgt.setEncodeRequestUrlElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getEncodeRequestUrlElement())); } + if (src.hasParamsElement()) + tgt.setParamsElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getParamsElement())); 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()); + if (src.hasResponseIdElement()) + tgt.setResponseIdElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getResponseIdElement())); + if (src.hasSourceIdElement()) + tgt.setSourceIdElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getSourceIdElement())); + if (src.hasTargetIdElement()) { + tgt.setTargetIdElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getTargetIdElement())); } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getUrlElement())); return tgt; } @@ -438,12 +406,10 @@ 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); - if (src.hasField()) { - tgt.setField(src.getField()); - } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } + if (src.hasFieldElement()) + tgt.setFieldElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getFieldElement())); + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getValueElement())); return tgt; } @@ -452,12 +418,10 @@ 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); - if (src.hasField()) { - tgt.setField(src.getField()); - } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } + if (src.hasFieldElement()) + tgt.setFieldElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getFieldElement())); + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getValueElement())); return tgt; } @@ -516,34 +480,29 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept()) tgt.addUseContext(VersionConvertor_10_30.convertCodeableConcept(t.getValueCodeableConcept())); if (src.hasJurisdiction()) { @@ -552,9 +511,8 @@ public class TestScript10_30 { if (src.hasPurpose()) { tgt.setRequirements(src.getPurpose()); } - if (src.hasCopyright()) { - tgt.setCopyright(src.getCopyright()); - } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); if (src.hasMetadata()) { tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); } @@ -584,34 +542,29 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); 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()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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()); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgt.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); else @@ -619,9 +572,8 @@ public class TestScript10_30 { if (src.hasRequirements()) { tgt.setPurpose(src.getRequirements()); } - if (src.hasCopyright()) { - tgt.setCopyright(src.getCopyright()); - } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); if (src.hasMetadata()) { tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); } @@ -651,9 +603,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -665,9 +616,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -679,11 +629,11 @@ 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); - if (src.hasAutocreate()) { - tgt.setAutocreate(src.getAutocreate()); + if (src.hasAutocreateElement()) { + tgt.setAutocreateElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getAutocreateElement())); } - if (src.hasAutodelete()) { - tgt.setAutodelete(src.getAutodelete()); + if (src.hasAutodeleteElement()) { + tgt.setAutodeleteElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getAutodeleteElement())); } if (src.hasResource()) { tgt.setResource(VersionConvertor_10_30.convertReference(src.getResource())); @@ -696,11 +646,11 @@ 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); - if (src.hasAutocreate()) { - tgt.setAutocreate(src.getAutocreate()); + if (src.hasAutocreateElement()) { + tgt.setAutocreateElement((BooleanType) VersionConvertor_10_30.convertType(src.getAutocreateElement())); } - if (src.hasAutodelete()) { - tgt.setAutodelete(src.getAutodelete()); + if (src.hasAutodeleteElement()) { + tgt.setAutodeleteElement((BooleanType) VersionConvertor_10_30.convertType(src.getAutodeleteElement())); } if (src.hasResource()) { tgt.setResource(VersionConvertor_10_30.convertReference(src.getResource())); @@ -713,17 +663,16 @@ 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); - if (src.hasRequired()) { - tgt.setRequired(src.getRequired()); + if (src.hasRequiredElement()) { + tgt.setRequiredElement((BooleanType) VersionConvertor_10_30.convertType(src.getRequiredElement())); } - if (src.hasValidated()) { - tgt.setValidated(src.getValidated()); + if (src.hasValidatedElement()) { + tgt.setValidatedElement((BooleanType) VersionConvertor_10_30.convertType(src.getValidatedElement())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } - if (src.hasDestination()) { - tgt.setDestination(src.getDestination()); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasDestinationElement()) { + tgt.setDestinationElement((IntegerType) VersionConvertor_10_30.convertType(src.getDestinationElement())); } if (src.hasLink()) { for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); @@ -739,17 +688,16 @@ 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); - if (src.hasRequired()) { - tgt.setRequired(src.getRequired()); + if (src.hasRequiredElement()) { + tgt.setRequiredElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getRequiredElement())); } - if (src.hasValidated()) { - tgt.setValidated(src.getValidated()); + if (src.hasValidatedElement()) { + tgt.setValidatedElement((org.hl7.fhir.dstu3.model.BooleanType) VersionConvertor_10_30.convertType(src.getValidatedElement())); } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } - if (src.hasDestination()) { - tgt.setDestination(src.getDestination()); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); + if (src.hasDestinationElement()) { + tgt.setDestinationElement((org.hl7.fhir.dstu3.model.IntegerType) VersionConvertor_10_30.convertType(src.getDestinationElement())); } if (src.hasLink()) { for (org.hl7.fhir.dstu2.model.UriType t : src.getLink()) tgt.addLink(t.getValue()); @@ -793,12 +741,10 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); return tgt; } @@ -807,12 +753,10 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); return tgt; } @@ -865,12 +809,10 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasAction()) { for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); } @@ -882,12 +824,10 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); if (src.hasAction()) { for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction()) tgt.addAction(convertTestActionComponent(t)); } @@ -899,18 +839,14 @@ 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); - 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()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasHeaderFieldElement()) + tgt.setHeaderFieldElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getHeaderFieldElement())); + if (src.hasPathElement()) + tgt.setPathElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPathElement())); + if (src.hasSourceIdElement()) + tgt.setSourceIdElement((org.hl7.fhir.dstu3.model.IdType) VersionConvertor_10_30.convertType(src.getSourceIdElement())); return tgt; } @@ -919,18 +855,14 @@ 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); - 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()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); + if (src.hasHeaderFieldElement()) + tgt.setHeaderFieldElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getHeaderFieldElement())); + if (src.hasPathElement()) + tgt.setPathElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPathElement())); + if (src.hasSourceIdElement()) + tgt.setSourceIdElement((org.hl7.fhir.dstu2.model.IdType) VersionConvertor_10_30.convertType(src.getSourceIdElement())); 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 46d783b98..62c36a6a5 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 @@ -2,12 +2,13 @@ package org.hl7.fhir.convertors.conv10_30; import org.hl7.fhir.convertors.VersionConvertorAdvisor30; import org.hl7.fhir.convertors.VersionConvertor_10_30; -import org.hl7.fhir.dstu3.model.CodeSystem; +import org.hl7.fhir.dstu3.model.*; 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; +import java.util.Collections; public class ValueSet10_30 { @@ -16,12 +17,10 @@ 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); - if (src.hasCode()) { - tgt.setCode(src.getCode()); - } - if (src.hasDisplay()) { - tgt.setDisplay(src.getDisplay()); - } + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); + if (src.hasDisplayElement()) + tgt.setDisplayElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDisplayElement())); if (src.hasDesignation()) { for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); } @@ -33,12 +32,10 @@ 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); - if (src.hasCode()) { - tgt.setCode(src.getCode()); - } - if (src.hasDisplay()) { - tgt.setDisplay(src.getDisplay()); - } + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); + if (src.hasDisplayElement()) + tgt.setDisplayElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDisplayElement())); if (src.hasDesignation()) { for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent t : src.getDesignation()) tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); } @@ -50,15 +47,13 @@ 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); - if (src.hasLanguage()) { - tgt.setLanguage(src.getLanguage()); - } + if (src.hasLanguageElement()) + tgt.setLanguageElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getLanguageElement())); if (src.hasUse()) { tgt.setUse(VersionConvertor_10_30.convertCoding(src.getUse())); } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getValueElement())); return tgt; } @@ -67,15 +62,13 @@ 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); - if (src.hasLanguage()) { - tgt.setLanguage(src.getLanguage()); - } + if (src.hasLanguageElement()) + tgt.setLanguageElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getLanguageElement())); if (src.hasUse()) { tgt.setUse(VersionConvertor_10_30.convertCoding(src.getUse())); } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getValueElement())); return tgt; } @@ -84,12 +77,10 @@ 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); - if (src.hasSystem()) { - tgt.setSystem(src.getSystem()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } + if (src.hasSystemElement()) + tgt.setSystemElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getSystemElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); if (src.hasConcept()) { for (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); } @@ -104,12 +95,10 @@ 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); - if (src.hasSystem()) { - tgt.setSystem(src.getSystem()); - } - if (src.hasVersion()) { - tgt.setVersion(src.getVersion()); - } + if (src.hasSystemElement()) + tgt.setSystemElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getSystemElement())); + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); if (src.hasConcept()) { for (org.hl7.fhir.dstu2.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) tgt.addConcept(convertConceptReferenceComponent(t)); } @@ -124,15 +113,13 @@ 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); - if (src.hasProperty()) { - tgt.setProperty(src.getProperty()); - } + if (src.hasPropertyElement()) + tgt.setPropertyElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getPropertyElement())); if (src.hasOp()) { tgt.setOp(convertFilterOperator(src.getOp())); } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getValueElement())); return tgt; } @@ -141,15 +128,13 @@ 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); - if (src.hasProperty()) { - tgt.setProperty(src.getProperty()); - } + if (src.hasPropertyElement()) + tgt.setPropertyElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getPropertyElement())); if (src.hasOp()) { tgt.setOp(convertFilterOperator(src.getOp())); } - if (src.hasValue()) { - tgt.setValue(src.getValue()); - } + if (src.hasValueElement()) + tgt.setValueElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getValueElement())); return tgt; } @@ -200,47 +185,41 @@ 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); - if (src.hasUrl()) { - tgt.setUrl(src.getUrl()); - } + if (src.hasUrlElement()) + tgt.setUrlElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getUrlElement())); 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.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasStatus()) { tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgt.setPublisher(src.getPublisher()); - } + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) + tgt.setPublisherElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); 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()); - if (src.hasDescription()) { - tgt.setDescription(src.getDescription()); - } + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) + tgt.setDescriptionElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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)); - if (src.hasImmutable()) { - tgt.setImmutable(src.getImmutable()); + if (src.hasImmutableElement()) { + tgt.setImmutableElement((BooleanType) VersionConvertor_10_30.convertType(src.getImmutableElement())); } - if (src.hasRequirements()) { - tgt.setPurpose(src.getRequirements()); - } - if (src.hasCopyright()) { - tgt.setCopyright(src.getCopyright()); + if (src.hasRequirementsElement()) { + tgt.setPurposeElement((MarkdownType) VersionConvertor_10_30.convertType(src.getRequirementsElement())); } + if (src.hasCopyrightElement()) + tgt.setCopyrightElement((org.hl7.fhir.dstu3.model.MarkdownType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); if (src.hasExtensible()) { tgt.setExtensible(src.getExtensible()); } @@ -248,8 +227,8 @@ public class ValueSet10_30 { if (src.hasCompose()) { tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); } - if (src.hasLockedDate()) { - tgt.getCompose().setLockedDate(src.getLockedDate()); + if (src.hasLockedDateElement()) { + tgt.getCompose().setLockedDateElement((DateType) VersionConvertor_10_30.convertType(src.getLockedDateElement())); } } if (src.hasCodeSystem() && advisor != null) { @@ -270,18 +249,18 @@ public class ValueSet10_30 { if (src.hasStatus()) { tgtcs.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); } - if (src.hasExperimental()) - tgtcs.setExperimental(src.getExperimental()); - if (src.hasPublisher()) { - tgtcs.setPublisher(src.getPublisher()); + if (src.hasExperimentalElement()) + tgtcs.setExperimentalElement((BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + if (src.hasPublisherElement()) { + tgtcs.setPublisherElement((StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); } 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()); - if (src.hasDescription()) { - tgtcs.setDescription(src.getDescription()); + if (src.hasDateElement()) + tgtcs.setDateElement((DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + if (src.hasDescriptionElement()) { + tgtcs.setDescriptionElement((MarkdownType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); } for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t)) tgtcs.addJurisdiction(VersionConvertor_10_30.convertCodeableConcept(t)); @@ -290,8 +269,8 @@ public class ValueSet10_30 { if (src.hasRequirements()) { tgtcs.setPurpose(src.getRequirements()); } - if (src.hasCopyright()) { - tgtcs.setCopyright(src.getCopyright()); + if (src.hasCopyrightElement()) { + tgtcs.setCopyrightElement((MarkdownType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); } tgtcs.setContent(CodeSystemContentMode.COMPLETE); if (src.hasCodeSystem()) { @@ -317,31 +296,31 @@ public class ValueSet10_30 { VersionConvertor_10_30.copyDomainResource(src, tgt); tgt.setUrl(src.getUrl()); for (org.hl7.fhir.dstu3.model.Identifier i : src.getIdentifier()) tgt.setIdentifier(VersionConvertor_10_30.convertIdentifier(i)); - tgt.setVersion(src.getVersion()); - tgt.setName(src.getName()); + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); tgt.setStatus(VersionConvertor_10_30.convertConformanceResourceStatus(src.getStatus())); - if (src.hasExperimental()) - tgt.setExperimental(src.getExperimental()); - tgt.setPublisher(src.getPublisher()); + if (src.hasExperimentalElement()) + tgt.setExperimentalElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getExperimentalElement())); + tgt.setPublisherElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPublisherElement())); for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertValueSetContactComponent(t)); - if (src.hasDate()) - tgt.setDate(src.getDate()); - tgt.setLockedDate(src.getCompose().getLockedDate()); - tgt.setDescription(src.getDescription()); + if (src.hasDateElement()) + tgt.setDateElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getDateElement())); + tgt.setLockedDateElement((org.hl7.fhir.dstu2.model.DateType) VersionConvertor_10_30.convertType(src.getCompose().getLockedDateElement())); + tgt.setDescriptionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDescriptionElement())); 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.setImmutable(src.getImmutable()); - tgt.setRequirements(src.getPurpose()); - tgt.setCopyright(src.getCopyright()); - tgt.setExtensible(src.getExtensible()); + tgt.setImmutableElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getImmutableElement())); + tgt.setRequirementsElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getPurposeElement())); + tgt.setCopyrightElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getCopyrightElement())); + tgt.setExtensibleElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getExtensibleElement())); org.hl7.fhir.dstu3.model.CodeSystem srcCS = (CodeSystem) src.getUserData("r2-cs"); if (srcCS == null) srcCS = advisor.getCodeSystem(src); if (srcCS != null) { - tgt.getCodeSystem().setSystem(srcCS.getUrl()); - tgt.getCodeSystem().setVersion(srcCS.getVersion()); - tgt.getCodeSystem().setCaseSensitive(srcCS.getCaseSensitive()); + tgt.getCodeSystem().setSystemElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(srcCS.getUrlElement())); + tgt.getCodeSystem().setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(srcCS.getVersionElement())); + tgt.getCodeSystem().setCaseSensitiveElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(srcCS.getCaseSensitiveElement())); for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent cs : srcCS.getConcept()) processConcept(tgt.getCodeSystem().getConcept(), cs, srcCS); } tgt.setCompose(convertValueSetComposeComponent(src.getCompose(), srcCS == null ? null : srcCS.getUrl())); @@ -395,9 +374,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -409,9 +387,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasTelecom()) { for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(VersionConvertor_10_30.convertContactPoint(t)); } @@ -423,17 +400,15 @@ 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); - if (src.hasIdentifier()) { - tgt.setIdentifier(src.getIdentifier()); + if (src.hasIdentifierElement()) + tgt.setIdentifierElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getIdentifierElement())); + if (src.hasTimestampElement()) + tgt.setTimestampElement((org.hl7.fhir.dstu3.model.DateTimeType) VersionConvertor_10_30.convertType(src.getTimestampElement())); + if (src.hasTotalElement()) { + tgt.setTotalElement((IntegerType) VersionConvertor_10_30.convertType(src.getTotalElement())); } - if (src.hasTimestamp()) { - tgt.setTimestamp(src.getTimestamp()); - } - if (src.hasTotal()) { - tgt.setTotal(src.getTotal()); - } - if (src.hasOffset()) { - tgt.setOffset(src.getOffset()); + if (src.hasOffsetElement()) { + tgt.setOffsetElement((IntegerType) VersionConvertor_10_30.convertType(src.getOffsetElement())); } if (src.hasParameter()) { for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); @@ -449,17 +424,15 @@ 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); - if (src.hasIdentifier()) { - tgt.setIdentifier(src.getIdentifier()); + if (src.hasIdentifierElement()) + tgt.setIdentifierElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getIdentifierElement())); + if (src.hasTimestampElement()) + tgt.setTimestampElement((org.hl7.fhir.dstu2.model.DateTimeType) VersionConvertor_10_30.convertType(src.getTimestampElement())); + if (src.hasTotalElement()) { + tgt.setTotalElement((org.hl7.fhir.dstu2.model.IntegerType) VersionConvertor_10_30.convertType(src.getTotalElement())); } - if (src.hasTimestamp()) { - tgt.setTimestamp(src.getTimestamp()); - } - if (src.hasTotal()) { - tgt.setTotal(src.getTotal()); - } - if (src.hasOffset()) { - tgt.setOffset(src.getOffset()); + if (src.hasOffsetElement()) { + tgt.setOffsetElement((org.hl7.fhir.dstu2.model.IntegerType) VersionConvertor_10_30.convertType(src.getOffsetElement())); } if (src.hasParameter()) { for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) tgt.addParameter(convertValueSetExpansionParameterComponent(t)); @@ -475,21 +448,17 @@ 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); - 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.hasSystemElement()) + tgt.setSystemElement((org.hl7.fhir.dstu2.model.UriType) VersionConvertor_10_30.convertType(src.getSystemElement())); + if (src.hasAbstractElement()) { + tgt.setAbstractElement((org.hl7.fhir.dstu2.model.BooleanType) VersionConvertor_10_30.convertType(src.getAbstractElement())); } + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); + if (src.hasDisplayElement()) + tgt.setDisplayElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getDisplayElement())); if (src.hasContains()) { for (org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); } @@ -501,21 +470,17 @@ 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); - 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.hasSystemElement()) + tgt.setSystemElement((org.hl7.fhir.dstu3.model.UriType) VersionConvertor_10_30.convertType(src.getSystemElement())); + if (src.hasAbstractElement()) { + tgt.setAbstractElement((BooleanType) VersionConvertor_10_30.convertType(src.getAbstractElement())); } + if (src.hasVersionElement()) + tgt.setVersionElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getVersionElement())); + if (src.hasCodeElement()) + tgt.setCodeElement((org.hl7.fhir.dstu3.model.CodeType) VersionConvertor_10_30.convertType(src.getCodeElement())); + if (src.hasDisplayElement()) + tgt.setDisplayElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getDisplayElement())); if (src.hasContains()) { for (org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) tgt.addContains(convertValueSetExpansionContainsComponent(t)); } @@ -527,9 +492,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasValue()) { tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); } @@ -541,9 +505,8 @@ 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); - if (src.hasName()) { - tgt.setName(src.getName()); - } + if (src.hasNameElement()) + tgt.setNameElement((org.hl7.fhir.dstu3.model.StringType) VersionConvertor_10_30.convertType(src.getNameElement())); if (src.hasValue()) { tgt.setValue(VersionConvertor_10_30.convertType(src.getValue())); } @@ -553,16 +516,16 @@ public class ValueSet10_30 { static public void processConcept(List concepts, org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent cs, CodeSystem tgtcs) throws FHIRException { org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent ct = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent(); concepts.add(ct); - ct.setCode(cs.getCode()); - ct.setDisplay(cs.getDisplay()); - ct.setDefinition(cs.getDefinition()); + ct.setCodeElement((CodeType) VersionConvertor_10_30.convertType(cs.getCodeElement())); + ct.setDisplayElement((StringType) VersionConvertor_10_30.convertType(cs.getDisplayElement())); + ct.setDefinitionElement((StringType) VersionConvertor_10_30.convertType(cs.getDefinitionElement())); if (cs.getAbstract()) CodeSystemUtilities.setNotSelectable(tgtcs, ct); for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent csd : cs.getDesignation()) { org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent cst = new org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent(); - cst.setLanguage(csd.getLanguage()); + cst.setLanguageElement((CodeType) VersionConvertor_10_30.convertType(csd.getLanguageElement())); cst.setUse(VersionConvertor_10_30.convertCoding(csd.getUse())); - cst.setValue(csd.getValue()); + cst.setValueElement((StringType) VersionConvertor_10_30.convertType(csd.getValueElement())); } for (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent csc : cs.getConcept()) processConcept(ct.getConcept(), csc, tgtcs); } @@ -570,16 +533,16 @@ public class ValueSet10_30 { static public void processConcept(List concepts, ConceptDefinitionComponent cs, CodeSystem srcCS) throws FHIRException { org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent ct = new org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent(); concepts.add(ct); - ct.setCode(cs.getCode()); - ct.setDisplay(cs.getDisplay()); - ct.setDefinition(cs.getDefinition()); + ct.setCodeElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(cs.getCodeElement())); + ct.setDisplayElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(cs.getDisplayElement())); + ct.setDefinitionElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(cs.getDefinitionElement())); if (CodeSystemUtilities.isNotSelectable(srcCS, cs)) ct.setAbstract(true); for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent csd : cs.getDesignation()) { org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent cst = new org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent(); - cst.setLanguage(csd.getLanguage()); + cst.setLanguageElement((org.hl7.fhir.dstu2.model.CodeType) VersionConvertor_10_30.convertType(csd.getLanguageElement())); cst.setUse(VersionConvertor_10_30.convertCoding(csd.getUse())); - cst.setValue(csd.getValue()); + cst.setValueElement((org.hl7.fhir.dstu2.model.StringType) VersionConvertor_10_30.convertType(csd.getValueElement())); } for (ConceptDefinitionComponent csc : cs.getConcept()) processConcept(ct.getConcept(), csc, srcCS); } 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 index e667fbbd7..103728fbe 100644 --- 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 @@ -4,13 +4,14 @@ import com.github.javaparser.StaticJavaParser; import com.github.javaparser.ast.*; import com.github.javaparser.ast.body.*; import com.github.javaparser.ast.comments.Comment; -import com.github.javaparser.ast.expr.*; +import com.github.javaparser.ast.expr.Expression; +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.*; -import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.ast.type.Type; import com.github.javaparser.ast.type.VarType; import com.github.javaparser.ast.visitor.ModifierVisitor; @@ -24,8 +25,6 @@ import com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSol 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 jdk.nashorn.internal.runtime.options.Option; -import org.checkerframework.checker.nullness.Opt; import org.hl7.fhir.dstu3.model.Enumeration; import org.hl7.fhir.dstu3.model.MedicationAdministration; @@ -53,29 +52,21 @@ public class Parser { "Markdown", "Oid", "PositiveInt", "String", "Time", "UnsignedInt", "Uri", "Url", "Uuid", "XhtmlNode"); - private static final String ONE_TO_ONE = "tgt.set%1$sElement((%3$s%4$s) VersionConvertor_%2$s.convertType(src.get%1$sElement()));"; - private static final String ONE_TO_MANY = "tgt.set%1$s(Collections.singletonList((%3$s%4$s) VersionConvertor_%2$s.convertType(src.get%1$sElement())));"; - private static final String MANY_TO_ONE = "tgt.set%1$sElement((%3$s%4$s) VersionConvertor_%2$s.convertType(src.get%1$s().get(0)));"; - private static final String MANY_TO_MANY = "tgt.set%1$s(src.get%1$s().stream()\n" + - ".map(toConvert -> (%3$s%4$s) VersionConvertor_%2$s.convertType(toConvert))\n" + - ".collect(Collectors.toList())\n" + - ");"; - - private static org.hl7.fhir.r5.model.Enumeration - convertMedicationAdministrationStatus(org.hl7.fhir.dstu3.model.Enumeration 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(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.fromCode(src.getValueAsString())); - return tgt; - } - - private static void copyElement(Enumeration src, - org.hl7.fhir.r5.model.Enumeration tgt) { - - } +// private static org.hl7.fhir.r5.model.Enumeration +// convertMedicationAdministrationStatus(org.hl7.fhir.dstu3.model.Enumeration 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(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.fromCode(src.getValueAsString())); +// return tgt; +// } +// +// private static void copyElement(java.util.Enumeration src, +// org.hl7.fhir.r5.model.Enumeration tgt) { +// +// } /** @@ -101,20 +92,22 @@ public class Parser { // VERSION_FILES.forEach(version -> { - String version = "10_30"; - List filenames = listAllJavaFilesInDirectory(new File("").getAbsolutePath() + "/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv" + version + "/"); - Collections.sort(filenames); - filenames.forEach(name -> { - try { - modifyElementNotField("/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv" + version + "/", name, ".java", listOfPrimitiveTypes, version); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - }); + String version = "10_30"; + List filenames = listAllJavaFilesInDirectory(new File("").getAbsolutePath() + "/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv" + version + "/"); + System.out.println("Checking the following files:"); + Collections.sort(filenames); + filenames.forEach(System.out::println); + filenames.forEach(name -> { + try { + modifyElementNotField("/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv" + version + "/", name, ".java", listOfPrimitiveTypes, version); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + }); // }); // try { -// modifyElementNotField("/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/", "Account40_50", ".java", listOfPrimitiveTypes, "10_30"); +// modifyElementNotField("/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/", "Subscription10_30", ".java", listOfPrimitiveTypes, "10_30"); // modifyElementNotField("/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/", "AuditEvent10_30", ".java", listOfPrimitiveTypes, "10_30"); // modifyElementNotField("/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/", "Binary10_30", ".java", listOfPrimitiveTypes, "10_30"); // modifyElementNotField("/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/", "Bundle10_30", ".java", listOfPrimitiveTypes, "10_30"); @@ -130,92 +123,89 @@ public class Parser { System.out.println("File :: " + filename); String projectDirectory = new File("").getAbsolutePath(); + String srcFilePathWithExtension = projectDirectory + srcdirectory + filename + extension; long start = System.currentTimeMillis(); CompilationUnit compilationUnit = getCompilationUnit(projectDirectory + srcdirectory + filename + extension); ClassOrInterfaceDeclaration classOrInterfaceDeclaration = initializeTypeSovlerAndParser(compilationUnit, projectDirectory, srcdirectory, filename); - MethodDeclaration declaration; + Set visited = new HashSet<>(); - Optional declarationOption = classOrInterfaceDeclaration.getMethods().stream() + HashMap ifStatementToConditions = new HashMap<>(); + HashMap> keyWordToIfStatement = new HashMap<>(); + + final HashMap generatedBlockStmt = new HashMap<>(); + + MethodDeclaration declaration = classOrInterfaceDeclaration.getMethods().stream() .filter(md -> md.getNameAsString().equals("convert" + extractName(filename))) - .findFirst(); - if (!declarationOption.isPresent()) { - return; - } else { - declaration = declarationOption.get(); // Can't find - } + .findFirst().get(); String lowerVersionTypeAbsPath = getLowerVersionAbsPathFromImportStatement(declaration.getTypeAsString(), declaration.getParameter(0).getTypeAsString(), version); String higherVersionTypeAbsPath = getHigherVersionAbsPath(declaration.getTypeAsString(), declaration.getParameter(0).getTypeAsString(), version); CompilationUnit lowerCU = StaticJavaParser.parse(new File(lowerVersionTypeAbsPath)); CompilationUnit higherCU = StaticJavaParser.parse(new File(higherVersionTypeAbsPath)); + System.out.println(); List methods = classOrInterfaceDeclaration.getMethods(); - for (MethodDeclaration md : methods) { + methods.forEach(md -> { - String type = resolveInnerType(md.getType()).asString(); - String param = resolveInnerType(md.getParameter(0).getType()).asString(); - if (type == "void") continue; - try { - type = !type.contains(".") ? resolveInnerType(md.getType()).resolve().asReferenceType().getQualifiedName() : type; - } catch (Exception e) { - System.out.println(); - } - - param = !param.contains(".") ? resolveInnerType(md.getParameter(0).getType()).resolve().asReferenceType().getQualifiedName() : param; - - String absFilePathOfClassMethodIsConvertingTo = importStatementToAbsolutePath(type); - String absFilePathOfClassMethodIsConvertingFrom = importStatementToAbsolutePath(param); - String classNameMethodIsConvertingTo = absFilePathOfClassMethodIsConvertingTo.substring(absFilePathOfClassMethodIsConvertingTo.lastIndexOf('/') + 1, absFilePathOfClassMethodIsConvertingTo.lastIndexOf('.')); - String classNameMethodIsConvertingFrom = absFilePathOfClassMethodIsConvertingFrom.substring(absFilePathOfClassMethodIsConvertingFrom.lastIndexOf('/') + 1, absFilePathOfClassMethodIsConvertingFrom.lastIndexOf('.')); + String toType = importStatementToAbsolutePath(md.getType().asString()); + String fromType = importStatementToAbsolutePath(md.getParameter(0).getType().asString()); ClassOrInterfaceDeclaration toTypeClass = null; ClassOrInterfaceDeclaration fromTypeClass = null; - String highBackupModelDirectoryToSearch = higherVersionTypeAbsPath.substring(0, higherVersionTypeAbsPath.lastIndexOf('/') + 1); - String lowBackupModelDirectoryToSearch = lowerVersionTypeAbsPath.substring(0, lowerVersionTypeAbsPath.lastIndexOf('/') + 1); + String lowerVersionAbsPath = getLowerVersionAbsPathFromAbsPath(toType, fromType, version); + String toString = toType.substring(toType.lastIndexOf('/') + 1, toType.lastIndexOf('.')); - Node declaration1 = null; - Node declaration2 = null; - boolean isEnum = false; + String fromString = fromType.substring(fromType.lastIndexOf('/') + 1, fromType.lastIndexOf('.')); + if (toType.equals(lowerVersionAbsPath)) { + try { + if (toString.equals(extractName(filename))) { + toTypeClass = lowerCU.getClassByName(toString).get(); + fromTypeClass = higherCU.getClassByName(fromString).get(); + } else { + Node declaration1 = getDeclaration(lowerCU, filename, toString); + if (declaration1 instanceof ClassOrInterfaceDeclaration) { + toTypeClass = (ClassOrInterfaceDeclaration) declaration1; + } else if (declaration1 instanceof EnumDeclaration) { + System.out.println("Filename " + filename + " target String " + toString + ", is an EnumDeclaration"); + } - try { - if (getVersionStringFromPath(lowerVersionTypeAbsPath).equals(getVersionStringFromPath(absFilePathOfClassMethodIsConvertingTo))) { - declaration1 = getDeclaration(lowerCU, classNameMethodIsConvertingTo, lowBackupModelDirectoryToSearch); - } else { - declaration1 = getDeclaration(higherCU, classNameMethodIsConvertingTo, highBackupModelDirectoryToSearch); + Node declaration2 = getDeclaration(higherCU, filename, fromString); + if (declaration2 instanceof ClassOrInterfaceDeclaration) { + fromTypeClass = (ClassOrInterfaceDeclaration) declaration2; + } else if (declaration2 instanceof EnumDeclaration) { + System.out.println("Filename " + filename + " target String " + toString + ", is an EnumDeclaration"); + } + } + } catch (Exception e) { + System.out.println(); } - - if (getVersionStringFromPath(lowerVersionTypeAbsPath).equals(getVersionStringFromPath(absFilePathOfClassMethodIsConvertingFrom))) { - declaration2 = getDeclaration(lowerCU, classNameMethodIsConvertingFrom, lowBackupModelDirectoryToSearch); - } else { - declaration2 = getDeclaration(higherCU, classNameMethodIsConvertingFrom, highBackupModelDirectoryToSearch); + } else { + try { + if (toString.equals(extractName(filename))) { + toTypeClass = higherCU.getClassByName(toString).get(); + fromTypeClass = lowerCU.getClassByName(fromString).get(); + } else { + Node declaration1 = getDeclaration(higherCU, filename, toString); + if (declaration1 instanceof ClassOrInterfaceDeclaration) { + toTypeClass = (ClassOrInterfaceDeclaration) declaration1; + } else if (declaration1 instanceof EnumDeclaration) { + System.out.println("Filename " + filename + " target String " + toString + ", is an EnumDeclaration"); + } + Node declaration2 = getDeclaration(lowerCU, filename, fromString); + if (declaration2 instanceof ClassOrInterfaceDeclaration) { + fromTypeClass = (ClassOrInterfaceDeclaration) declaration2; + } else if (declaration2 instanceof EnumDeclaration) { + System.out.println("Filename " + filename + " target String " + toString + ", is an EnumDeclaration"); + } + } + } catch (Exception e) { + System.out.println(); } - } catch (FileNotFoundException e) { - System.out.println(e.getMessage()); - } - - if (declaration1 instanceof ClassOrInterfaceDeclaration) { - toTypeClass = (ClassOrInterfaceDeclaration) declaration1; - } else if (declaration1 instanceof EnumDeclaration) { - isEnum = true; - System.out.println("Filename " + filename + " target String " + classNameMethodIsConvertingTo + ", is an EnumDeclaration"); - } - if (declaration2 instanceof ClassOrInterfaceDeclaration) { - fromTypeClass = (ClassOrInterfaceDeclaration) declaration2; - } else if (declaration2 instanceof EnumDeclaration) { - isEnum = true; - System.out.println("Filename " + filename + " target String " + classNameMethodIsConvertingTo + ", is an EnumDeclaration"); - } - - if ((toTypeClass == null || fromTypeClass == null) && !isEnum) { - System.out.println(); - } else if (!isEnum) { - System.out.println("FROM " + fromTypeClass.getNameAsString()); - System.out.println("TO " + toTypeClass.getNameAsString()); } if (toTypeClass != null && fromTypeClass != null) { @@ -223,193 +213,193 @@ public class Parser { ClassOrInterfaceDeclaration finalToTypeClass = toTypeClass; md.accept(new ModifierVisitor() { @Override - public Visitable visit(IfStmt ifStmt, Void arg) { - super.visit(ifStmt, arg); - processIfStatement(ifStmt); + public Visitable visit(MethodCallExpr n, Void arg) { + super.visit(n, arg); + if (n.getNameAsString().contains("get") && !visited.contains(n.getNameAsString())) { + visited.add(n.getNameAsString()); + Optional first = finalFromTypeClass.getMethods().stream() + .filter(md -> md.getNameAsString().equals(n.getNameAsString())) + .findFirst(); - return ifStmt; + if (first.isPresent()) { + + Node topLevelMethodExpr = getTopLevelMethodExpr(n); + Node topLevelIfStatement = getTopLevelIfStatement(n); + + String type = first.get().getType().toString(); + + String baseString = n.getNameAsString().replace("get", ""); + + if (listOfPrimitiveTypes.contains(type)) { + ElementParserEntry e = new ElementParserEntry(); + // do get + Optional firstGetElementMethod = finalFromTypeClass.getMethods().stream() + .filter(methodDeclaration -> methodDeclaration.getNameAsString().equals("get" + baseString + ELEMENT)) + .findFirst(); + if (firstGetElementMethod.isPresent()) { + e.setGetType(firstGetElementMethod.get().getType().toString()); + } else { + finalFromTypeClass.getMethods().stream() + .filter(methodDeclaration -> methodDeclaration.getNameAsString().equals("get" + baseString)) + .findFirst().ifPresent(md -> e.setGetType(md.getType().toString())); + } + + // do set and add + Optional firstSetElementMethod = finalToTypeClass.getMethods().stream() + .filter(methodDeclaration -> methodDeclaration.getNameAsString().equals("set" + baseString + ELEMENT)) + .findFirst(); + if (firstSetElementMethod.isPresent()) { + e.setSetType(firstSetElementMethod.get().getParameter(0).getType().toString()); + } else { + finalToTypeClass.getMethods().stream() + .filter(methodDeclaration -> methodDeclaration.getNameAsString().equals("set" + baseString)) + .findFirst().ifPresent(md -> e.setSetType(md.getParameter(0).getType().toString())); + } + + Optional firstAddElementMethod = finalToTypeClass.getMethods().stream() + .filter(methodDeclaration -> methodDeclaration.getNameAsString().equals("add" + baseString + ELEMENT)) + .findFirst(); + if (firstAddElementMethod.isPresent()) { + e.setAddType(firstAddElementMethod.get().getType().toString()); + } else { + finalToTypeClass.getMethods().stream() + .filter(methodDeclaration -> methodDeclaration.getNameAsString().equals("add" + baseString + ELEMENT)) + .findFirst().ifPresent(md -> e.setAddType(md.getType().toString())); + } + + // do check + if (topLevelIfStatement != null && (((IfStmt) topLevelIfStatement).getCondition() instanceof MethodCallExpr)) { + String nameAsString = ((MethodCallExpr) ((IfStmt) topLevelIfStatement).getCondition()).getNameAsString(); + String finalNameAsString = nameAsString; + finalFromTypeClass.getMethods().stream() + .filter(methodDeclaration -> methodDeclaration.getNameAsString().equals(finalNameAsString)) + .findFirst().ifPresent(methodDeclaration -> { + e.setHasCheck(methodDeclaration.getType().toString()); + }); + } + + ifStatementToConditions.put((IfStmt) topLevelIfStatement, e); + if (!keyWordToIfStatement.containsKey(baseString)) { + keyWordToIfStatement.put(baseString, new ArrayList<>()); + } + keyWordToIfStatement.get(baseString).add((IfStmt) topLevelIfStatement); + } + } + } + + return n; } - }, null); + visited.clear(); } - //System.out.println("Execution time :: " + (System.currentTimeMillis() - start) / 1000); - - } - } - - public static void processIfStatement(IfStmt ifStmt) { - Expression condition = ifStmt.getCondition(); - Statement thenStmt = ifStmt.getThenStmt(); - //Handle multiple big if blocks - if ((thenStmt instanceof BlockStmt) && (thenStmt.getChildNodes().size() > 1)) { - thenStmt.getChildNodes().forEach(n -> { - if (n instanceof IfStmt) { - processIfStatement((IfStmt) n); - } else { - System.out.println(); - } - }); - } else if (thenStmt instanceof IfStmt) { - processIfStatement((IfStmt) thenStmt); - } else { - Expression expression = processGetStatement(thenStmt); - if (expression != null && !expression.toString().contains("get")) { - System.out.println(); - } else if (expression == null) { - System.out.println("Logger :: was not able to get a getStatement for if statement :: " + ifStmt.toString()); - } - } - } - - public static Expression processGetStatement(Node stmt) { - - if ((stmt instanceof ReturnStmt) || (stmt instanceof ThrowStmt) || (stmt instanceof TryStmt) - || (stmt instanceof NameExpr) || (stmt instanceof FieldAccessExpr) || (stmt instanceof BooleanLiteralExpr) - || (stmt instanceof ConditionalExpr) || (stmt instanceof StringLiteralExpr)) { - // ignore - } else if (stmt instanceof IfStmt) { - System.out.println(); - } else if (stmt instanceof ForEachStmt) { - return ((ForEachStmt) stmt).getIterable(); - } else if (stmt instanceof BlockStmt) { - if (stmt.getChildNodes().size() > 1) { - System.out.println(); - } else { - return processGetStatement(stmt.getChildNodes().get(0)); - } - } else if (stmt instanceof ExpressionStmt) { - return processGetStatement(((ExpressionStmt) stmt).getExpression()); - } else if (stmt instanceof MethodCallExpr) { - if (((MethodCallExpr) stmt).getArguments().size() > 0) { - return processGetStatement(((MethodCallExpr) stmt).getArgument(0)); - } else { - return containsOrReturnNull((Expression) stmt, "get"); - } - } else if (stmt instanceof AssignExpr) { - if (((AssignExpr) stmt).getOperator().equals(AssignExpr.Operator.ASSIGN)) { - return (processGetStatement(stmt.getChildNodes().get(1))); - } else { - System.out.println(); - } - } else if (stmt instanceof UnaryExpr) { - return containsOrReturnNull((Expression) stmt, "get"); - } else if (stmt instanceof BinaryExpr) { - if (((BinaryExpr) stmt).getLeft().toString().contains("get")) { - return processGetStatement(((BinaryExpr) stmt).getLeft()); - } else { - return processGetStatement(((BinaryExpr) stmt).getRight()); - } - } else if (stmt instanceof CastExpr) { - return processGetStatement(((CastExpr) stmt).getExpression()); - } else if (stmt instanceof Expression) { - System.out.println(); - } else { - System.out.println("You haven't caught this then statement case yet."); - System.exit(0); - } - - return null; - } - - public static Expression containsOrReturnNull(Expression e, String keyWord) { - if (e.toString().contains(keyWord)) { - return e; - } else { - return null; - } - } - - public static Type resolveInnerType(Type type) { - Type toReturn = type; - if (type.toString().contains("List") && !type.toString().contains("List_") - && !type.toString().contains("ListResource") && !type.toString().contains("ListMode")) { + String returnTypeDir = null; try { - toReturn = (Type) type.getChildNodes().get(1); + returnTypeDir = getDirectoryOfOppositeModel(md.getParameter(0).getTypeAsString(), version); } catch (Exception e) { System.out.println(); } - } - return toReturn; - } - public static String removeListToGetTypeString(String type) { - if (type.contains("List")) { - type = type.replaceAll("List", "").replaceAll("<", "").replaceAll(">", ""); - } - return type; - } + String condition = "src.has%1$sElement()"; + String statementWithSet = "tgt.set%1$sElement((%3$s%4$s) VersionConvertor_%2$s.convertType(src.get%1$sElement()));"; - public static boolean methodExistsInClass(ClassOrInterfaceDeclaration c, String methodName) { - Optional first = c.getMethods().stream() - .filter(md -> md.getNameAsString().equals(methodName)) - .findAny(); - return first.isPresent(); - } + String oneToOne = "tgt.set%1$sElement((%3$s%4$s) VersionConvertor_%2$s.convertType(src.get%1$sElement()));"; + String oneToMany = "tgt.set%1$s(Collections.singletonList((%3$s%4$s) VersionConvertor_%2$s.convertType(src.get%1$sElement())));"; + String manyToOne = "tgt.set%1$sElement((%3$s%4$s) VersionConvertor_%2$s.convertType(src.get%1$s().get(0)));"; + String manyToMany = "tgt.set%1$s(src.get%1$s().stream()\n" + + ".map(toConvert -> (%3$s%4$s) VersionConvertor_%2$s.convertType(toConvert))\n" + + ".collect(Collectors.toList())\n" + + ");"; - public static MethodDeclaration getMethod(ClassOrInterfaceDeclaration c, String methodName) { - if (!methodExistsInClass(c, methodName)) { - throw new IllegalStateException("Cannot get a method " + methodName + " in class " + c.getNameAsString() + " doesn't exist in class."); - } - return c.getMethods().stream() - .filter(md -> md.getNameAsString().equals(methodName)) - .findFirst().get(); - } + if (returnTypeDir != null) { + for (String s : keyWordToIfStatement.keySet()) { + for (IfStmt ifState : keyWordToIfStatement.get(s)) { + ElementParserEntry e = ifStatementToConditions.get(ifState); + String finalReturnTypeDir = returnTypeDir; + if (e.hasAdd || e.hasSet) { + md.accept(new ModifierVisitor() { + @Override + public Visitable visit(IfStmt n, Void arg) { + super.visit(n, arg); + if (n.equals(ifState)) { + String template = null; + if (e.getType.contains("List") && getToType(e).contains("List")) { + template = manyToMany; + } else if (e.getType.contains("List") && !getToType(e).contains("List")) { + template = manyToOne; + } else if (!e.getType.contains("List") && getToType(e).contains("List")) { + template = oneToMany; + } else { + template = oneToOne; + } - public static TypeDeclaration getDeclaration(CompilationUnit cu, String targetNodeString, String backupModelDirectory) throws FileNotFoundException { - if (targetNodeString.contains(".")) { - return null; - // not handling this - } + e.setType = e.setType.replaceAll("List", "").replaceAll("<", "").replaceAll(">", ""); + e.addType = e.setType.replaceAll("List", "").replaceAll("<", "").replaceAll(">", ""); - if (cu.getClassByName(targetNodeString).isPresent()) { - return (TypeDeclaration) cu.getClassByName(targetNodeString).get(); - } + Expression conditionExp = e.hasCheck ? StaticJavaParser.parseExpression(String.format(condition, s)) : n.getCondition(); + Statement thenStatement = null; + try { + thenStatement = StaticJavaParser.parseStatement(String.format(template, s, version, finalReturnTypeDir, e.hasSet ? e.setType : e.addType)); + n = new IfStmt(conditionExp, thenStatement, null); + } catch (Exception e1) { + System.out.println(); + } + } + return n; + } - TypeDeclaration td = getClassOrEnumNodeThatExistsWithin(cu, targetNodeString); - if (td == null) { - File target = new File(backupModelDirectory + targetNodeString + ".java"); - if (!target.exists()) { - target = new File(backupModelDirectory + "Enumerations" + ".java"); + private String getToType(ElementParserEntry e) { + if (e.hasSet) { + return e.setType; + } else { + return ""; + } + } + }, null); + } + } + } } - cu = StaticJavaParser.parse(target); - td = getClassOrEnumNodeThatExistsWithin(cu, targetNodeString); + }); + + deleteFile(srcFilePathWithExtension); + + try { + compilationUnit.addImport("java.util.Collections"); + writeStringToFile(compilationUnit.toString(), srcFilePathWithExtension); + } catch (IOException e) { + e.printStackTrace(); } - if (td == null) { - System.out.println("No target with name " + targetNodeString + " found"); - } - return td; + + System.out.println("Execution time :: " + (System.currentTimeMillis() - start) / 1000); + } - public static TypeDeclaration getClassOrEnumNodeThatExistsWithin(CompilationUnit cu, String targetName) { - List collect = cu.getChildNodes().stream() - .filter(node -> node instanceof TypeDeclaration) - .map(node -> (TypeDeclaration) node) - .collect(Collectors.toList()); - for (TypeDeclaration td : collect) { - TypeDeclaration search = getClassOrEnumNodeThatExistsWithin(td, targetName); - if (search != null) { - return search; + public static Node getDeclaration(CompilationUnit cu, String filename, String targetNodeString) { + Optional classByName = cu.getClassByName(extractName(filename)); + Optional first = null; + if (classByName.isPresent()) { + + first = classByName.get().getChildNodes().stream() + .filter(node -> node instanceof ClassOrInterfaceDeclaration) + .filter(node -> ((ClassOrInterfaceDeclaration) node).getNameAsString().equals(targetNodeString)) + .findFirst(); + + if (!first.isPresent()) { + first = classByName.get().getChildNodes().stream() + .filter(node -> node instanceof EnumDeclaration) + .filter(node -> ((EnumDeclaration) node).getNameAsString().equals(targetNodeString)) + .findFirst(); } } - return null; - } - public static TypeDeclaration getClassOrEnumNodeThatExistsWithin(TypeDeclaration c, String targetName) { - if (c.getNameAsString().equals(targetName)) return c; - List collect = c.getChildNodes().stream() - .filter(node -> node instanceof TypeDeclaration) - .map(node -> (TypeDeclaration) node) - .collect(Collectors.toList()); - for (TypeDeclaration td : collect) { - TypeDeclaration search = getClassOrEnumNodeThatExistsWithin(td, targetName); - if (search != null) { - return search; - } + if (first == null || !first.isPresent()) { + throw new IllegalStateException("No target with name " + targetNodeString + " found in file " + filename); + } else { + return first.get(); } - return null; } public static class ElementParserEntry { @@ -684,8 +674,7 @@ public class Parser { } - private static List getAdditionalClassDeclarations(ClassOrInterfaceDeclaration - classOrInterfaceDeclaration) { + private static List getAdditionalClassDeclarations(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { List collect = new ArrayList<>(); classOrInterfaceDeclaration.accept(new VoidVisitorAdapter() { @Override @@ -732,8 +721,7 @@ public class Parser { return classOrInterfaceDeclaration.get(); } - private static HashMap> generateMapOfTopLevelMethods(ClassOrInterfaceDeclaration - classOrInterfaceDeclaration) { + private static HashMap> generateMapOfTopLevelMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { System.out.println("==================== Generating List of Parsable Types ====================\n"); HashMap> mapToReturn = new HashMap<>(); @@ -831,8 +819,7 @@ public class Parser { } } - public static void dealWithV2ExceptionCasesPreProcessing(CompilationUnit cu, ClassOrInterfaceDeclaration - classOrInterfaceDeclaration, String version) { + 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); @@ -846,8 +833,7 @@ public class Parser { } - public static void dealWithV2ExceptionCasesPostProcessing(ClassOrInterfaceDeclaration - classOrInterfaceDeclaration, String version) { + 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); @@ -921,8 +907,7 @@ public class Parser { } - public static MethodDeclaration getConvertResourceMethodForVersion(ClassOrInterfaceDeclaration - classOrInterfaceDeclaration, + public static MethodDeclaration getConvertResourceMethodForVersion(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, String methodName, String modelType, String version) { @@ -1268,8 +1253,7 @@ public class Parser { * @param classOrInterfaceDeclaration * @return */ - protected static List getListOfParsableTypes(ClassOrInterfaceDeclaration - classOrInterfaceDeclaration) { + 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)); @@ -1284,8 +1268,7 @@ public class Parser { * @param method * @return List of all {@link MethodDeclaration} */ - public static List getAllCalledMethods(ClassOrInterfaceDeclaration - classOrInterfaceDeclaration, MethodDeclaration method) { + public static List getAllCalledMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, MethodDeclaration method) { List result = new ArrayList<>(); List methodCallExprs = new ArrayList<>(); @@ -1317,8 +1300,7 @@ public class Parser { * @param methodNames {@link List} of method names * @return {@link List } containing any of the keywords */ - protected static List getTopLevelMethods(ClassOrInterfaceDeclaration - classOrInterfaceDeclaration, List methodNames) { + protected static List getTopLevelMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration, List methodNames) { List toReturn = new ArrayList<>(); methodNames.stream() .map(s -> getListOfClassMethods(s, classOrInterfaceDeclaration)) @@ -1480,8 +1462,7 @@ public class Parser { * @param classOrInterfaceDeclaration {@link ClassOrInterfaceDeclaration} * @return {@link List} of all {@link MethodDeclaration} */ - protected static List getListOfClassMethods(ClassOrInterfaceDeclaration - classOrInterfaceDeclaration) { + protected static List getListOfClassMethods(ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { return getListOfClassMethods("", classOrInterfaceDeclaration); } @@ -1492,8 +1473,7 @@ public class Parser { * @param classOrInterfaceDeclaration {@link ClassOrInterfaceDeclaration} * @return {@link List} of all matching {@link MethodDeclaration} */ - protected static List getListOfClassMethods(String methodName, ClassOrInterfaceDeclaration - classOrInterfaceDeclaration) { + protected static List getListOfClassMethods(String methodName, ClassOrInterfaceDeclaration classOrInterfaceDeclaration) { List result = new ArrayList<>(); classOrInterfaceDeclaration.getMethods().stream() .filter(method -> method.getName().toString().equals(methodName)) @@ -1687,16 +1667,6 @@ public class Parser { public static final String MODEL_ABSOLUTE_PATH = "/org.hl7.fhir.%1$s/src/main/java/org/hl7/fhir/%1$s/model/%2$s.java"; public static final String MODEL_PATH_WITHOUT_IMPORT = "/org.hl7.fhir.%1$s/src/main/java/"; - public static String getVersionStringFromPath(String path) { - if (path.contains("dstu2")) return "dstu2"; - if (path.contains("dstu2016may")) return "dstu2016may"; - if (path.contains("dstu3")) return "dstu3"; - if (path.contains("r4")) return "r4"; - if (path.contains("r5")) return "r5"; - - return null; - } - public static String getVersionString(String version) { switch (version) { case ("10"): @@ -1791,15 +1761,13 @@ public class Parser { } } - public static String getLowerVersionAbsPathFromImportStatement(String type1ImportStatement, String - type2ImportStatement, String version) { + public static String getLowerVersionAbsPathFromImportStatement(String type1ImportStatement, String type2ImportStatement, String version) { String type1Path = importStatementToAbsolutePath(type1ImportStatement); String type2Path = importStatementToAbsolutePath(type2ImportStatement); return getLowerVersionAbsPathFromAbsPath(type1Path, type2Path, version); } - public static String getHigherVersionAbsPath(String type1ImportStatement, String type2ImportStatement, String - version) { + public static String getHigherVersionAbsPath(String type1ImportStatement, String type2ImportStatement, String version) { String type1Path = importStatementToAbsolutePath(type1ImportStatement); String type2Path = importStatementToAbsolutePath(type2ImportStatement);