From 97a61b2ff9e6c9198392704704adb6a89508fc23 Mon Sep 17 00:00:00 2001 From: dotasek Date: Thu, 18 Jul 2024 18:42:57 -0400 Subject: [PATCH] Return null for all toCode enum params that are null --- .../org/hl7/fhir/dstu2/model/Account.java | 2 ++ .../org/hl7/fhir/dstu2/model/Address.java | 4 +++ .../fhir/dstu2/model/AllergyIntolerance.java | 12 ++++++++ .../org/hl7/fhir/dstu2/model/Appointment.java | 6 ++++ .../fhir/dstu2/model/AppointmentResponse.java | 2 ++ .../org/hl7/fhir/dstu2/model/AuditEvent.java | 8 ++++- .../java/org/hl7/fhir/dstu2/model/Bundle.java | 6 ++++ .../org/hl7/fhir/dstu2/model/CarePlan.java | 6 ++++ .../java/org/hl7/fhir/dstu2/model/Claim.java | 4 +++ .../fhir/dstu2/model/ClinicalImpression.java | 2 ++ .../hl7/fhir/dstu2/model/Communication.java | 2 ++ .../dstu2/model/CommunicationRequest.java | 2 ++ .../org/hl7/fhir/dstu2/model/Composition.java | 4 +++ .../org/hl7/fhir/dstu2/model/Condition.java | 2 ++ .../org/hl7/fhir/dstu2/model/Conformance.java | 24 +++++++++++++++ .../hl7/fhir/dstu2/model/ContactPoint.java | 4 +++ .../org/hl7/fhir/dstu2/model/DataElement.java | 2 ++ .../hl7/fhir/dstu2/model/DetectedIssue.java | 2 ++ .../java/org/hl7/fhir/dstu2/model/Device.java | 2 ++ .../hl7/fhir/dstu2/model/DeviceComponent.java | 2 ++ .../hl7/fhir/dstu2/model/DeviceMetric.java | 10 +++++++ .../fhir/dstu2/model/DeviceUseRequest.java | 4 +++ .../hl7/fhir/dstu2/model/DiagnosticOrder.java | 4 +++ .../fhir/dstu2/model/DiagnosticReport.java | 2 ++ .../fhir/dstu2/model/DocumentReference.java | 2 ++ .../fhir/dstu2/model/ElementDefinition.java | 8 +++++ .../org/hl7/fhir/dstu2/model/Encounter.java | 6 ++++ .../hl7/fhir/dstu2/model/Enumerations.java | 30 +++++++++++++++++++ .../hl7/fhir/dstu2/model/EpisodeOfCare.java | 2 ++ .../fhir/dstu2/model/FamilyMemberHistory.java | 2 ++ .../java/org/hl7/fhir/dstu2/model/Flag.java | 2 ++ .../java/org/hl7/fhir/dstu2/model/Goal.java | 2 ++ .../java/org/hl7/fhir/dstu2/model/Group.java | 2 ++ .../fhir/dstu2/model/HealthcareService.java | 2 ++ .../org/hl7/fhir/dstu2/model/HumanName.java | 2 ++ .../org/hl7/fhir/dstu2/model/Identifier.java | 2 ++ .../hl7/fhir/dstu2/model/ImagingStudy.java | 2 ++ .../fhir/dstu2/model/ImplementationGuide.java | 6 ++++ .../java/org/hl7/fhir/dstu2/model/List_.java | 4 +++ .../org/hl7/fhir/dstu2/model/Location.java | 4 +++ .../java/org/hl7/fhir/dstu2/model/Media.java | 2 ++ .../dstu2/model/MedicationAdministration.java | 2 ++ .../fhir/dstu2/model/MedicationDispense.java | 2 ++ .../hl7/fhir/dstu2/model/MedicationOrder.java | 2 ++ .../fhir/dstu2/model/MedicationStatement.java | 2 ++ .../hl7/fhir/dstu2/model/MessageHeader.java | 2 ++ .../hl7/fhir/dstu2/model/NamingSystem.java | 4 +++ .../org/hl7/fhir/dstu2/model/Narrative.java | 2 ++ .../hl7/fhir/dstu2/model/NutritionOrder.java | 2 ++ .../org/hl7/fhir/dstu2/model/Observation.java | 4 +++ .../fhir/dstu2/model/OperationDefinition.java | 4 +++ .../fhir/dstu2/model/OperationOutcome.java | 4 +++ .../hl7/fhir/dstu2/model/OrderResponse.java | 2 ++ .../org/hl7/fhir/dstu2/model/Patient.java | 2 ++ .../java/org/hl7/fhir/dstu2/model/Person.java | 2 ++ .../org/hl7/fhir/dstu2/model/Procedure.java | 2 ++ .../fhir/dstu2/model/ProcedureRequest.java | 4 +++ .../hl7/fhir/dstu2/model/ProcessRequest.java | 2 ++ .../org/hl7/fhir/dstu2/model/Provenance.java | 2 ++ .../org/hl7/fhir/dstu2/model/Quantity.java | 2 ++ .../hl7/fhir/dstu2/model/Questionnaire.java | 4 +++ .../dstu2/model/QuestionnaireResponse.java | 2 ++ .../hl7/fhir/dstu2/model/ReferralRequest.java | 2 ++ .../hl7/fhir/dstu2/model/SearchParameter.java | 2 ++ .../java/org/hl7/fhir/dstu2/model/Slot.java | 2 ++ .../org/hl7/fhir/dstu2/model/Specimen.java | 2 ++ .../fhir/dstu2/model/StructureDefinition.java | 4 +++ .../hl7/fhir/dstu2/model/Subscription.java | 4 +++ .../hl7/fhir/dstu2/model/SupplyDelivery.java | 2 ++ .../hl7/fhir/dstu2/model/SupplyRequest.java | 2 ++ .../org/hl7/fhir/dstu2/model/TestScript.java | 8 +++++ .../java/org/hl7/fhir/dstu2/model/Timing.java | 4 +++ .../org/hl7/fhir/dstu2/model/ValueSet.java | 2 ++ .../fhir/dstu2/model/VisionPrescription.java | 4 +++ 74 files changed, 289 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Account.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Account.java index fbb52a827..1fc31d432 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Account.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Account.java @@ -151,6 +151,8 @@ public class Account extends DomainResource { } public String toCode(AccountStatus code) { + if (code == null) + return null; if (code == AccountStatus.ACTIVE) return "active"; if (code == AccountStatus.INACTIVE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Address.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Address.java index 1bcd0f1ba..b76322e97 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Address.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Address.java @@ -189,6 +189,8 @@ public class Address extends Type implements ICompositeType { } public String toCode(AddressUse code) { + if (code == null) + return null; if (code == AddressUse.HOME) return "home"; if (code == AddressUse.WORK) @@ -322,6 +324,8 @@ public class Address extends Type implements ICompositeType { } public String toCode(AddressType code) { + if (code == null) + return null; if (code == AddressType.POSTAL) return "postal"; if (code == AddressType.PHYSICAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AllergyIntolerance.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AllergyIntolerance.java index 6999e2dde..dca4cf2ad 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AllergyIntolerance.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AllergyIntolerance.java @@ -249,6 +249,8 @@ public class AllergyIntolerance extends DomainResource { } public String toCode(AllergyIntoleranceStatus code) { + if (code == null) + return null; if (code == AllergyIntoleranceStatus.ACTIVE) return "active"; if (code == AllergyIntoleranceStatus.UNCONFIRMED) @@ -395,6 +397,8 @@ public class AllergyIntolerance extends DomainResource { } public String toCode(AllergyIntoleranceCriticality code) { + if (code == null) + return null; if (code == AllergyIntoleranceCriticality.CRITL) return "CRITL"; if (code == AllergyIntoleranceCriticality.CRITH) @@ -514,6 +518,8 @@ public class AllergyIntolerance extends DomainResource { } public String toCode(AllergyIntoleranceType code) { + if (code == null) + return null; if (code == AllergyIntoleranceType.ALLERGY) return "allergy"; if (code == AllergyIntoleranceType.INTOLERANCE) @@ -661,6 +667,8 @@ public class AllergyIntolerance extends DomainResource { } public String toCode(AllergyIntoleranceCategory code) { + if (code == null) + return null; if (code == AllergyIntoleranceCategory.FOOD) return "food"; if (code == AllergyIntoleranceCategory.MEDICATION) @@ -798,6 +806,8 @@ public class AllergyIntolerance extends DomainResource { } public String toCode(AllergyIntoleranceCertainty code) { + if (code == null) + return null; if (code == AllergyIntoleranceCertainty.UNLIKELY) return "unlikely"; if (code == AllergyIntoleranceCertainty.LIKELY) @@ -929,6 +939,8 @@ public class AllergyIntolerance extends DomainResource { } public String toCode(AllergyIntoleranceSeverity code) { + if (code == null) + return null; if (code == AllergyIntoleranceSeverity.MILD) return "mild"; if (code == AllergyIntoleranceSeverity.MODERATE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Appointment.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Appointment.java index 3c516c3fd..e740aee21 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Appointment.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Appointment.java @@ -248,6 +248,8 @@ public class Appointment extends DomainResource { } public String toCode(AppointmentStatus code) { + if (code == null) + return null; if (code == AppointmentStatus.PROPOSED) return "proposed"; if (code == AppointmentStatus.PENDING) @@ -389,6 +391,8 @@ public class Appointment extends DomainResource { } public String toCode(ParticipantRequired code) { + if (code == null) + return null; if (code == ParticipantRequired.REQUIRED) return "required"; if (code == ParticipantRequired.OPTIONAL) @@ -542,6 +546,8 @@ public class Appointment extends DomainResource { } public String toCode(ParticipationStatus code) { + if (code == null) + return null; if (code == ParticipationStatus.ACCEPTED) return "accepted"; if (code == ParticipationStatus.DECLINED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AppointmentResponse.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AppointmentResponse.java index d259d8597..99a21f91e 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AppointmentResponse.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AppointmentResponse.java @@ -225,6 +225,8 @@ public class AppointmentResponse extends DomainResource { } public String toCode(ParticipantStatus code) { + if (code == null) + return null; if (code == ParticipantStatus.ACCEPTED) return "accepted"; if (code == ParticipantStatus.DECLINED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AuditEvent.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AuditEvent.java index 75a36585e..d138bff5d 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AuditEvent.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/AuditEvent.java @@ -209,6 +209,8 @@ public class AuditEvent extends DomainResource { } public String toCode(AuditEventAction code) { + if (code == null) + return null; if (code == AuditEventAction.C) return "C"; if (code == AuditEventAction.R) @@ -365,6 +367,8 @@ public class AuditEvent extends DomainResource { } public String toCode(AuditEventOutcome code) { + if (code == null) + return null; if (code == AuditEventOutcome._0) return "0"; if (code == AuditEventOutcome._4) @@ -497,7 +501,7 @@ public class AuditEvent extends DomainResource { } public static class AuditEventParticipantNetworkTypeEnumFactory - implements EnumFactory { + implements EnumFactory { public AuditEventParticipantNetworkType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) @@ -535,6 +539,8 @@ public class AuditEvent extends DomainResource { } public String toCode(AuditEventParticipantNetworkType code) { + if (code == null) + return null; if (code == AuditEventParticipantNetworkType._1) return "1"; if (code == AuditEventParticipantNetworkType._2) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Bundle.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Bundle.java index 3f364ead0..2fc8c06c7 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Bundle.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Bundle.java @@ -287,6 +287,8 @@ public class Bundle extends Resource implements IBaseBundle { } public String toCode(BundleType code) { + if (code == null) + return null; if (code == BundleType.DOCUMENT) return "document"; if (code == BundleType.MESSAGE) @@ -432,6 +434,8 @@ public class Bundle extends Resource implements IBaseBundle { } public String toCode(SearchEntryMode code) { + if (code == null) + return null; if (code == SearchEntryMode.MATCH) return "match"; if (code == SearchEntryMode.INCLUDE) @@ -581,6 +585,8 @@ public class Bundle extends Resource implements IBaseBundle { } public String toCode(HTTPVerb code) { + if (code == null) + return null; if (code == HTTPVerb.GET) return "GET"; if (code == HTTPVerb.POST) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/CarePlan.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/CarePlan.java index 4a0f5fb34..605c289bd 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/CarePlan.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/CarePlan.java @@ -211,6 +211,8 @@ public class CarePlan extends DomainResource { } public String toCode(CarePlanStatus code) { + if (code == null) + return null; if (code == CarePlanStatus.PROPOSED) return "proposed"; if (code == CarePlanStatus.DRAFT) @@ -347,6 +349,8 @@ public class CarePlan extends DomainResource { } public String toCode(CarePlanRelationship code) { + if (code == null) + return null; if (code == CarePlanRelationship.INCLUDES) return "includes"; if (code == CarePlanRelationship.REPLACES) @@ -534,6 +538,8 @@ public class CarePlan extends DomainResource { } public String toCode(CarePlanActivityStatus code) { + if (code == null) + return null; if (code == CarePlanActivityStatus.NOTSTARTED) return "not-started"; if (code == CarePlanActivityStatus.SCHEDULED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Claim.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Claim.java index 4d3ec696d..974fd484e 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Claim.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Claim.java @@ -210,6 +210,8 @@ public class Claim extends DomainResource { } public String toCode(ClaimType code) { + if (code == null) + return null; if (code == ClaimType.INSTITUTIONAL) return "institutional"; if (code == ClaimType.ORAL) @@ -365,6 +367,8 @@ public class Claim extends DomainResource { } public String toCode(Use code) { + if (code == null) + return null; if (code == Use.COMPLETE) return "complete"; if (code == Use.PROPOSED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ClinicalImpression.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ClinicalImpression.java index 39a73f193..18f698157 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ClinicalImpression.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ClinicalImpression.java @@ -177,6 +177,8 @@ public class ClinicalImpression extends DomainResource { } public String toCode(ClinicalImpressionStatus code) { + if (code == null) + return null; if (code == ClinicalImpressionStatus.INPROGRESS) return "in-progress"; if (code == ClinicalImpressionStatus.COMPLETED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Communication.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Communication.java index 315176528..ae2ce5439 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Communication.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Communication.java @@ -209,6 +209,8 @@ public class Communication extends DomainResource { } public String toCode(CommunicationStatus code) { + if (code == null) + return null; if (code == CommunicationStatus.INPROGRESS) return "in-progress"; if (code == CommunicationStatus.COMPLETED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/CommunicationRequest.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/CommunicationRequest.java index 5cfd08527..eade54037 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/CommunicationRequest.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/CommunicationRequest.java @@ -300,6 +300,8 @@ public class CommunicationRequest extends DomainResource { } public String toCode(CommunicationRequestStatus code) { + if (code == null) + return null; if (code == CommunicationRequestStatus.PROPOSED) return "proposed"; if (code == CommunicationRequestStatus.PLANNED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Composition.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Composition.java index 969b54850..bdffc011a 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Composition.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Composition.java @@ -201,6 +201,8 @@ public class Composition extends DomainResource { } public String toCode(CompositionStatus code) { + if (code == null) + return null; if (code == CompositionStatus.PRELIMINARY) return "preliminary"; if (code == CompositionStatus.FINAL) @@ -354,6 +356,8 @@ public class Composition extends DomainResource { } public String toCode(CompositionAttestationMode code) { + if (code == null) + return null; if (code == CompositionAttestationMode.PERSONAL) return "personal"; if (code == CompositionAttestationMode.PROFESSIONAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Condition.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Condition.java index a220d6f3e..f5e9335cb 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Condition.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Condition.java @@ -232,6 +232,8 @@ public class Condition extends DomainResource { } public String toCode(ConditionVerificationStatus code) { + if (code == null) + return null; if (code == ConditionVerificationStatus.PROVISIONAL) return "provisional"; if (code == ConditionVerificationStatus.DIFFERENTIAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Conformance.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Conformance.java index ddaf72146..3b1e97f99 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Conformance.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Conformance.java @@ -181,6 +181,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(ConformanceStatementKind code) { + if (code == null) + return null; if (code == ConformanceStatementKind.INSTANCE) return "instance"; if (code == ConformanceStatementKind.CAPABILITY) @@ -330,6 +332,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(UnknownContentCode code) { + if (code == null) + return null; if (code == UnknownContentCode.NO) return "no"; if (code == UnknownContentCode.EXTENSIONS) @@ -445,6 +449,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(RestfulConformanceMode code) { + if (code == null) + return null; if (code == RestfulConformanceMode.CLIENT) return "client"; if (code == RestfulConformanceMode.SERVER) @@ -682,6 +688,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(TypeRestfulInteraction code) { + if (code == null) + return null; if (code == TypeRestfulInteraction.READ) return "read"; if (code == TypeRestfulInteraction.VREAD) @@ -826,6 +834,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(ResourceVersionPolicy code) { + if (code == null) + return null; if (code == ResourceVersionPolicy.NOVERSION) return "no-version"; if (code == ResourceVersionPolicy.VERSIONED) @@ -958,6 +968,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(ConditionalDeleteStatus code) { + if (code == null) + return null; if (code == ConditionalDeleteStatus.NOTSUPPORTED) return "not-supported"; if (code == ConditionalDeleteStatus.SINGLE) @@ -1226,6 +1238,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(SearchModifierCode code) { + if (code == null) + return null; if (code == SearchModifierCode.MISSING) return "missing"; if (code == SearchModifierCode.EXACT) @@ -1371,6 +1385,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(SystemRestfulInteraction code) { + if (code == null) + return null; if (code == SystemRestfulInteraction.TRANSACTION) return "transaction"; if (code == SystemRestfulInteraction.SEARCHSYSTEM) @@ -1520,6 +1536,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(TransactionMode code) { + if (code == null) + return null; if (code == TransactionMode.NOTSUPPORTED) return "not-supported"; if (code == TransactionMode.BATCH) @@ -1657,6 +1675,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(MessageSignificanceCategory code) { + if (code == null) + return null; if (code == MessageSignificanceCategory.CONSEQUENCE) return "Consequence"; if (code == MessageSignificanceCategory.CURRENCY) @@ -1770,6 +1790,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(ConformanceEventMode code) { + if (code == null) + return null; if (code == ConformanceEventMode.SENDER) return "sender"; if (code == ConformanceEventMode.RECEIVER) @@ -1881,6 +1903,8 @@ public class Conformance extends DomainResource implements IBaseConformance { } public String toCode(DocumentMode code) { + if (code == null) + return null; if (code == DocumentMode.PRODUCER) return "producer"; if (code == DocumentMode.CONSUMER) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ContactPoint.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ContactPoint.java index fe0dc3cd8..aac51fc49 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ContactPoint.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ContactPoint.java @@ -210,6 +210,8 @@ public class ContactPoint extends Type implements ICompositeType { } public String toCode(ContactPointSystem code) { + if (code == null) + return null; if (code == ContactPointSystem.PHONE) return "phone"; if (code == ContactPointSystem.FAX) @@ -388,6 +390,8 @@ public class ContactPoint extends Type implements ICompositeType { } public String toCode(ContactPointUse code) { + if (code == null) + return null; if (code == ContactPointUse.HOME) return "home"; if (code == ContactPointUse.WORK) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DataElement.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DataElement.java index 01857043e..530ddc7e6 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DataElement.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DataElement.java @@ -239,6 +239,8 @@ public class DataElement extends DomainResource { } public String toCode(DataElementStringency code) { + if (code == null) + return null; if (code == DataElementStringency.COMPARABLE) return "comparable"; if (code == DataElementStringency.FULLYSPECIFIED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DetectedIssue.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DetectedIssue.java index 0492759df..946ae43ab 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DetectedIssue.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DetectedIssue.java @@ -176,6 +176,8 @@ public class DetectedIssue extends DomainResource { } public String toCode(DetectedIssueSeverity code) { + if (code == null) + return null; if (code == DetectedIssueSeverity.HIGH) return "high"; if (code == DetectedIssueSeverity.MODERATE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Device.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Device.java index 007e0190a..13f898c17 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Device.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Device.java @@ -174,6 +174,8 @@ public class Device extends DomainResource { } public String toCode(DeviceStatus code) { + if (code == null) + return null; if (code == DeviceStatus.AVAILABLE) return "available"; if (code == DeviceStatus.NOTAVAILABLE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceComponent.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceComponent.java index 769772d41..b53d61c4c 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceComponent.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceComponent.java @@ -315,6 +315,8 @@ public class DeviceComponent extends DomainResource { } public String toCode(MeasmntPrinciple code) { + if (code == null) + return null; if (code == MeasmntPrinciple.OTHER) return "other"; if (code == MeasmntPrinciple.CHEMICAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceMetric.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceMetric.java index 6feb944a6..c6769670f 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceMetric.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceMetric.java @@ -170,6 +170,8 @@ public class DeviceMetric extends DomainResource { } public String toCode(DeviceMetricOperationalStatus code) { + if (code == null) + return null; if (code == DeviceMetricOperationalStatus.ON) return "on"; if (code == DeviceMetricOperationalStatus.OFF) @@ -391,6 +393,8 @@ public class DeviceMetric extends DomainResource { } public String toCode(DeviceMetricColor code) { + if (code == null) + return null; if (code == DeviceMetricColor.BLACK) return "black"; if (code == DeviceMetricColor.RED) @@ -551,6 +555,8 @@ public class DeviceMetric extends DomainResource { } public String toCode(DeviceMetricCategory code) { + if (code == null) + return null; if (code == DeviceMetricCategory.MEASUREMENT) return "measurement"; if (code == DeviceMetricCategory.SETTING) @@ -702,6 +708,8 @@ public class DeviceMetric extends DomainResource { } public String toCode(DeviceMetricCalibrationType code) { + if (code == null) + return null; if (code == DeviceMetricCalibrationType.UNSPECIFIED) return "unspecified"; if (code == DeviceMetricCalibrationType.OFFSET) @@ -853,6 +861,8 @@ public class DeviceMetric extends DomainResource { } public String toCode(DeviceMetricCalibrationState code) { + if (code == null) + return null; if (code == DeviceMetricCalibrationState.NOTCALIBRATED) return "not-calibrated"; if (code == DeviceMetricCalibrationState.CALIBRATIONREQUIRED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceUseRequest.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceUseRequest.java index cafc1b811..83b7ebdaf 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceUseRequest.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DeviceUseRequest.java @@ -297,6 +297,8 @@ public class DeviceUseRequest extends DomainResource { } public String toCode(DeviceUseRequestStatus code) { + if (code == null) + return null; if (code == DeviceUseRequestStatus.PROPOSED) return "proposed"; if (code == DeviceUseRequestStatus.PLANNED) @@ -460,6 +462,8 @@ public class DeviceUseRequest extends DomainResource { } public String toCode(DeviceUseRequestPriority code) { + if (code == null) + return null; if (code == DeviceUseRequestPriority.ROUTINE) return "routine"; if (code == DeviceUseRequestPriority.URGENT) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DiagnosticOrder.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DiagnosticOrder.java index 67516613f..0d69aa667 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DiagnosticOrder.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DiagnosticOrder.java @@ -352,6 +352,8 @@ public class DiagnosticOrder extends DomainResource { } public String toCode(DiagnosticOrderStatus code) { + if (code == null) + return null; if (code == DiagnosticOrderStatus.PROPOSED) return "proposed"; if (code == DiagnosticOrderStatus.DRAFT) @@ -521,6 +523,8 @@ public class DiagnosticOrder extends DomainResource { } public String toCode(DiagnosticOrderPriority code) { + if (code == null) + return null; if (code == DiagnosticOrderPriority.ROUTINE) return "routine"; if (code == DiagnosticOrderPriority.URGENT) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DiagnosticReport.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DiagnosticReport.java index acf8104e9..2bc76a302 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DiagnosticReport.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DiagnosticReport.java @@ -253,6 +253,8 @@ public class DiagnosticReport extends DomainResource { } public String toCode(DiagnosticReportStatus code) { + if (code == null) + return null; if (code == DiagnosticReportStatus.REGISTERED) return "registered"; if (code == DiagnosticReportStatus.PARTIAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DocumentReference.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DocumentReference.java index c1483c6d2..80052870b 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DocumentReference.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/DocumentReference.java @@ -191,6 +191,8 @@ public class DocumentReference extends DomainResource { } public String toCode(DocumentRelationshipType code) { + if (code == null) + return null; if (code == DocumentRelationshipType.REPLACES) return "replaces"; if (code == DocumentRelationshipType.TRANSFORMS) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ElementDefinition.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ElementDefinition.java index bcbba4b15..f94ce4975 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ElementDefinition.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ElementDefinition.java @@ -136,6 +136,8 @@ public class ElementDefinition extends Type implements ICompositeType { } public String toCode(PropertyRepresentation code) { + if (code == null) + return null; if (code == PropertyRepresentation.XMLATTR) return "xmlAttr"; return "?"; @@ -266,6 +268,8 @@ public class ElementDefinition extends Type implements ICompositeType { } public String toCode(SlicingRules code) { + if (code == null) + return null; if (code == SlicingRules.CLOSED) return "closed"; if (code == SlicingRules.OPEN) @@ -399,6 +403,8 @@ public class ElementDefinition extends Type implements ICompositeType { } public String toCode(AggregationMode code) { + if (code == null) + return null; if (code == AggregationMode.CONTAINED) return "contained"; if (code == AggregationMode.REFERENCED) @@ -513,6 +519,8 @@ public class ElementDefinition extends Type implements ICompositeType { } public String toCode(ConstraintSeverity code) { + if (code == null) + return null; if (code == ConstraintSeverity.ERROR) return "error"; if (code == ConstraintSeverity.WARNING) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Encounter.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Encounter.java index b2cd82309..28815c761 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Encounter.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Encounter.java @@ -226,6 +226,8 @@ public class Encounter extends DomainResource { } public String toCode(EncounterState code) { + if (code == null) + return null; if (code == EncounterState.PLANNED) return "planned"; if (code == EncounterState.ARRIVED) @@ -477,6 +479,8 @@ public class Encounter extends DomainResource { } public String toCode(EncounterClass code) { + if (code == null) + return null; if (code == EncounterClass.INPATIENT) return "inpatient"; if (code == EncounterClass.OUTPATIENT) @@ -645,6 +649,8 @@ public class Encounter extends DomainResource { } public String toCode(EncounterLocationStatus code) { + if (code == null) + return null; if (code == EncounterLocationStatus.PLANNED) return "planned"; if (code == EncounterLocationStatus.ACTIVE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Enumerations.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Enumerations.java index 236ea3b04..340f98523 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Enumerations.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Enumerations.java @@ -189,6 +189,8 @@ public class Enumerations { } public String toCode(AdministrativeGender code) { + if (code == null) + return null; if (code == AdministrativeGender.MALE) return "male"; if (code == AdministrativeGender.FEMALE) @@ -376,6 +378,8 @@ public class Enumerations { } public String toCode(AgeUnits code) { + if (code == null) + return null; if (code == AgeUnits.MIN) return "min"; if (code == AgeUnits.H) @@ -540,6 +544,8 @@ public class Enumerations { } public String toCode(BindingStrength code) { + if (code == null) + return null; if (code == BindingStrength.REQUIRED) return "required"; if (code == BindingStrength.EXTENSIBLE) @@ -796,6 +802,8 @@ public class Enumerations { } public String toCode(ConceptMapEquivalence code) { + if (code == null) + return null; if (code == ConceptMapEquivalence.EQUIVALENT) return "equivalent"; if (code == ConceptMapEquivalence.EQUAL) @@ -939,6 +947,8 @@ public class Enumerations { } public String toCode(ConformanceResourceStatus code) { + if (code == null) + return null; if (code == ConformanceResourceStatus.DRAFT) return "draft"; if (code == ConformanceResourceStatus.ACTIVE) @@ -1181,6 +1191,8 @@ public class Enumerations { } public String toCode(DataAbsentReason code) { + if (code == null) + return null; if (code == DataAbsentReason.UNKNOWN) return "unknown"; if (code == DataAbsentReason.ASKED) @@ -2129,6 +2141,8 @@ public class Enumerations { } public String toCode(DataType code) { + if (code == null) + return null; if (code == DataType.ADDRESS) return "Address"; if (code == DataType.AGE) @@ -2346,6 +2360,8 @@ public class Enumerations { } public String toCode(DocumentReferenceStatus code) { + if (code == null) + return null; if (code == DocumentReferenceStatus.CURRENT) return "current"; if (code == DocumentReferenceStatus.SUPERSEDED) @@ -5195,6 +5211,8 @@ public class Enumerations { } public String toCode(FHIRDefinedType code) { + if (code == null) + return null; if (code == FHIRDefinedType.ADDRESS) return "Address"; if (code == FHIRDefinedType.AGE) @@ -5738,6 +5756,8 @@ public class Enumerations { } public String toCode(MessageEvent code) { + if (code == null) + return null; if (code == MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE) return "MedicationAdministration-Complete"; if (code == MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION) @@ -5883,6 +5903,8 @@ public class Enumerations { } public String toCode(NoteType code) { + if (code == null) + return null; if (code == NoteType.DISPLAY) return "display"; if (code == NoteType.PRINT) @@ -5996,6 +6018,8 @@ public class Enumerations { } public String toCode(RemittanceOutcome code) { + if (code == null) + return null; if (code == RemittanceOutcome.COMPLETE) return "complete"; if (code == RemittanceOutcome.ERROR) @@ -7984,6 +8008,8 @@ public class Enumerations { } public String toCode(ResourceType code) { + if (code == null) + return null; if (code == ResourceType.ACCOUNT) return "Account"; if (code == ResourceType.ALLERGYINTOLERANCE) @@ -8398,6 +8424,8 @@ public class Enumerations { } public String toCode(SearchParamType code) { + if (code == null) + return null; if (code == SearchParamType.NUMBER) return "number"; if (code == SearchParamType.DATE) @@ -8594,6 +8622,8 @@ public class Enumerations { } public String toCode(SpecialValues code) { + if (code == null) + return null; if (code == SpecialValues.TRUE) return "true"; if (code == SpecialValues.FALSE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/EpisodeOfCare.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/EpisodeOfCare.java index 03795b876..14556e0fc 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/EpisodeOfCare.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/EpisodeOfCare.java @@ -235,6 +235,8 @@ public class EpisodeOfCare extends DomainResource { } public String toCode(EpisodeOfCareStatus code) { + if (code == null) + return null; if (code == EpisodeOfCareStatus.PLANNED) return "planned"; if (code == EpisodeOfCareStatus.WAITLIST) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/FamilyMemberHistory.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/FamilyMemberHistory.java index 006e46779..afba36b29 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/FamilyMemberHistory.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/FamilyMemberHistory.java @@ -192,6 +192,8 @@ public class FamilyMemberHistory extends DomainResource { } public String toCode(FamilyHistoryStatus code) { + if (code == null) + return null; if (code == FamilyHistoryStatus.PARTIAL) return "partial"; if (code == FamilyHistoryStatus.COMPLETED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Flag.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Flag.java index bd88f5854..0f834e324 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Flag.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Flag.java @@ -167,6 +167,8 @@ public class Flag extends DomainResource { } public String toCode(FlagStatus code) { + if (code == null) + return null; if (code == FlagStatus.ACTIVE) return "active"; if (code == FlagStatus.INACTIVE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Goal.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Goal.java index 187612892..1166ceb98 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Goal.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Goal.java @@ -284,6 +284,8 @@ public class Goal extends DomainResource { } public String toCode(GoalStatus code) { + if (code == null) + return null; if (code == GoalStatus.PROPOSED) return "proposed"; if (code == GoalStatus.PLANNED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Group.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Group.java index 1db13bc11..e3374b75e 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Group.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Group.java @@ -226,6 +226,8 @@ public class Group extends DomainResource { } public String toCode(GroupType code) { + if (code == null) + return null; if (code == GroupType.PERSON) return "person"; if (code == GroupType.ANIMAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/HealthcareService.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/HealthcareService.java index 7e8491827..e2bb03c7f 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/HealthcareService.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/HealthcareService.java @@ -241,6 +241,8 @@ public class HealthcareService extends DomainResource { } public String toCode(DaysOfWeek code) { + if (code == null) + return null; if (code == DaysOfWeek.MON) return "mon"; if (code == DaysOfWeek.TUE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/HumanName.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/HumanName.java index e127636e0..db390140b 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/HumanName.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/HumanName.java @@ -250,6 +250,8 @@ public class HumanName extends Type implements ICompositeType { } public String toCode(NameUse code) { + if (code == null) + return null; if (code == NameUse.USUAL) return "usual"; if (code == NameUse.OFFICIAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Identifier.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Identifier.java index 13bb37730..58f429377 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Identifier.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Identifier.java @@ -187,6 +187,8 @@ public class Identifier extends Type implements ICompositeType { } public String toCode(IdentifierUse code) { + if (code == null) + return null; if (code == IdentifierUse.USUAL) return "usual"; if (code == IdentifierUse.OFFICIAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ImagingStudy.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ImagingStudy.java index 13fda5def..eeffc90ca 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ImagingStudy.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ImagingStudy.java @@ -192,6 +192,8 @@ public class ImagingStudy extends DomainResource { } public String toCode(InstanceAvailability code) { + if (code == null) + return null; if (code == InstanceAvailability.ONLINE) return "ONLINE"; if (code == InstanceAvailability.OFFLINE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ImplementationGuide.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ImplementationGuide.java index ae6418291..ecc5d5ecc 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ImplementationGuide.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ImplementationGuide.java @@ -156,6 +156,8 @@ public class ImplementationGuide extends DomainResource { } public String toCode(GuideDependencyType code) { + if (code == null) + return null; if (code == GuideDependencyType.REFERENCE) return "reference"; if (code == GuideDependencyType.INCLUSION) @@ -343,6 +345,8 @@ public class ImplementationGuide extends DomainResource { } public String toCode(GuideResourcePurpose code) { + if (code == null) + return null; if (code == GuideResourcePurpose.EXAMPLE) return "example"; if (code == GuideResourcePurpose.TERMINOLOGY) @@ -573,6 +577,8 @@ public class ImplementationGuide extends DomainResource { } public String toCode(GuidePageKind code) { + if (code == null) + return null; if (code == GuidePageKind.PAGE) return "page"; if (code == GuidePageKind.EXAMPLE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/List_.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/List_.java index 392e5aef7..8284d1ed6 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/List_.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/List_.java @@ -170,6 +170,8 @@ public class List_ extends DomainResource { } public String toCode(ListStatus code) { + if (code == null) + return null; if (code == ListStatus.CURRENT) return "current"; if (code == ListStatus.RETIRED) @@ -302,6 +304,8 @@ public class List_ extends DomainResource { } public String toCode(ListMode code) { + if (code == null) + return null; if (code == ListMode.WORKING) return "working"; if (code == ListMode.SNAPSHOT) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Location.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Location.java index 4d3d8005c..7aa05e9b9 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Location.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Location.java @@ -173,6 +173,8 @@ public class Location extends DomainResource { } public String toCode(LocationStatus code) { + if (code == null) + return null; if (code == LocationStatus.ACTIVE) return "active"; if (code == LocationStatus.SUSPENDED) @@ -289,6 +291,8 @@ public class Location extends DomainResource { } public String toCode(LocationMode code) { + if (code == null) + return null; if (code == LocationMode.INSTANCE) return "instance"; if (code == LocationMode.KIND) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Media.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Media.java index 5448a7c4d..d15916d33 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Media.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Media.java @@ -169,6 +169,8 @@ public class Media extends DomainResource { } public String toCode(DigitalMediaType code) { + if (code == null) + return null; if (code == DigitalMediaType.PHOTO) return "photo"; if (code == DigitalMediaType.VIDEO) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationAdministration.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationAdministration.java index bc2274531..123553c60 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationAdministration.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationAdministration.java @@ -211,6 +211,8 @@ public class MedicationAdministration extends DomainResource { } public String toCode(MedicationAdministrationStatus code) { + if (code == null) + return null; if (code == MedicationAdministrationStatus.INPROGRESS) return "in-progress"; if (code == MedicationAdministrationStatus.ONHOLD) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationDispense.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationDispense.java index 0a2dc7a78..6df55e27c 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationDispense.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationDispense.java @@ -212,6 +212,8 @@ public class MedicationDispense extends DomainResource { } public String toCode(MedicationDispenseStatus code) { + if (code == null) + return null; if (code == MedicationDispenseStatus.INPROGRESS) return "in-progress"; if (code == MedicationDispenseStatus.ONHOLD) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationOrder.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationOrder.java index f469251b4..33e0bbecc 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationOrder.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationOrder.java @@ -232,6 +232,8 @@ public class MedicationOrder extends DomainResource { } public String toCode(MedicationOrderStatus code) { + if (code == null) + return null; if (code == MedicationOrderStatus.ACTIVE) return "active"; if (code == MedicationOrderStatus.ONHOLD) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationStatement.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationStatement.java index 7299f9f9f..24dee8780 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationStatement.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MedicationStatement.java @@ -209,6 +209,8 @@ public class MedicationStatement extends DomainResource { } public String toCode(MedicationStatementStatus code) { + if (code == null) + return null; if (code == MedicationStatementStatus.ACTIVE) return "active"; if (code == MedicationStatementStatus.COMPLETED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MessageHeader.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MessageHeader.java index 49116ca29..6dca4f40c 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MessageHeader.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/MessageHeader.java @@ -177,6 +177,8 @@ public class MessageHeader extends DomainResource { } public String toCode(ResponseType code) { + if (code == null) + return null; if (code == ResponseType.OK) return "ok"; if (code == ResponseType.TRANSIENTERROR) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/NamingSystem.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/NamingSystem.java index 4c39c2429..1c00f0d60 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/NamingSystem.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/NamingSystem.java @@ -177,6 +177,8 @@ public class NamingSystem extends DomainResource { } public String toCode(NamingSystemType code) { + if (code == null) + return null; if (code == NamingSystemType.CODESYSTEM) return "codesystem"; if (code == NamingSystemType.IDENTIFIER) @@ -329,6 +331,8 @@ public class NamingSystem extends DomainResource { } public String toCode(NamingSystemIdentifierType code) { + if (code == null) + return null; if (code == NamingSystemIdentifierType.OID) return "oid"; if (code == NamingSystemIdentifierType.UUID) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Narrative.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Narrative.java index 2a4fb4faf..d40e39a9f 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Narrative.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Narrative.java @@ -188,6 +188,8 @@ public class Narrative extends BaseNarrative implements INarrative { } public String toCode(NarrativeStatus code) { + if (code == null) + return null; if (code == NarrativeStatus.GENERATED) return "generated"; if (code == NarrativeStatus.EXTENSIONS) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/NutritionOrder.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/NutritionOrder.java index 9bdc1dd74..edc575af2 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/NutritionOrder.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/NutritionOrder.java @@ -264,6 +264,8 @@ public class NutritionOrder extends DomainResource { } public String toCode(NutritionOrderStatus code) { + if (code == null) + return null; if (code == NutritionOrderStatus.PROPOSED) return "proposed"; if (code == NutritionOrderStatus.DRAFT) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Observation.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Observation.java index 36683d69e..bcd2d7732 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Observation.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Observation.java @@ -249,6 +249,8 @@ public class Observation extends DomainResource { } public String toCode(ObservationStatus code) { + if (code == null) + return null; if (code == ObservationStatus.REGISTERED) return "registered"; if (code == ObservationStatus.PRELIMINARY) @@ -452,6 +454,8 @@ public class Observation extends DomainResource { } public String toCode(ObservationRelationshipType code) { + if (code == null) + return null; if (code == ObservationRelationshipType.HASMEMBER) return "has-member"; if (code == ObservationRelationshipType.DERIVEDFROM) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OperationDefinition.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OperationDefinition.java index 26f878aca..7d1b88e24 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OperationDefinition.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OperationDefinition.java @@ -157,6 +157,8 @@ public class OperationDefinition extends DomainResource { } public String toCode(OperationKind code) { + if (code == null) + return null; if (code == OperationKind.OPERATION) return "operation"; if (code == OperationKind.QUERY) @@ -268,6 +270,8 @@ public class OperationDefinition extends DomainResource { } public String toCode(OperationParameterUse code) { + if (code == null) + return null; if (code == OperationParameterUse.IN) return "in"; if (code == OperationParameterUse.OUT) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OperationOutcome.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OperationOutcome.java index 2108e1efd..7d5b94b61 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OperationOutcome.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OperationOutcome.java @@ -190,6 +190,8 @@ public class OperationOutcome extends DomainResource implements IBaseOperationOu } public String toCode(IssueSeverity code) { + if (code == null) + return null; if (code == IssueSeverity.FATAL) return "fatal"; if (code == IssueSeverity.ERROR) @@ -811,6 +813,8 @@ public class OperationOutcome extends DomainResource implements IBaseOperationOu } public String toCode(IssueType code) { + if (code == null) + return null; if (code == IssueType.INVALID) return "invalid"; if (code == IssueType.STRUCTURE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OrderResponse.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OrderResponse.java index 729c5a2bc..fd73c6139 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OrderResponse.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/OrderResponse.java @@ -279,6 +279,8 @@ public class OrderResponse extends DomainResource { } public String toCode(OrderStatus code) { + if (code == null) + return null; if (code == OrderStatus.PENDING) return "pending"; if (code == OrderStatus.REVIEW) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Patient.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Patient.java index 6b0b8ffda..9032c5f1b 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Patient.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Patient.java @@ -181,6 +181,8 @@ public class Patient extends DomainResource { } public String toCode(LinkType code) { + if (code == null) + return null; if (code == LinkType.REPLACE) return "replace"; if (code == LinkType.REFER) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Person.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Person.java index ff56bac0f..1ec129f5b 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Person.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Person.java @@ -190,6 +190,8 @@ public class Person extends DomainResource { } public String toCode(IdentityAssuranceLevel code) { + if (code == null) + return null; if (code == IdentityAssuranceLevel.LEVEL1) return "level1"; if (code == IdentityAssuranceLevel.LEVEL2) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Procedure.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Procedure.java index a85ddf308..a38fdb026 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Procedure.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Procedure.java @@ -188,6 +188,8 @@ public class Procedure extends DomainResource { } public String toCode(ProcedureStatus code) { + if (code == null) + return null; if (code == ProcedureStatus.INPROGRESS) return "in-progress"; if (code == ProcedureStatus.ABORTED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ProcedureRequest.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ProcedureRequest.java index dcbe4aab5..70ae4c132 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ProcedureRequest.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ProcedureRequest.java @@ -297,6 +297,8 @@ public class ProcedureRequest extends DomainResource { } public String toCode(ProcedureRequestStatus code) { + if (code == null) + return null; if (code == ProcedureRequestStatus.PROPOSED) return "proposed"; if (code == ProcedureRequestStatus.DRAFT) @@ -460,6 +462,8 @@ public class ProcedureRequest extends DomainResource { } public String toCode(ProcedureRequestPriority code) { + if (code == null) + return null; if (code == ProcedureRequestPriority.ROUTINE) return "routine"; if (code == ProcedureRequestPriority.URGENT) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ProcessRequest.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ProcessRequest.java index c7b15f2f3..414cd6d22 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ProcessRequest.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ProcessRequest.java @@ -189,6 +189,8 @@ public class ProcessRequest extends DomainResource { } public String toCode(ActionList code) { + if (code == null) + return null; if (code == ActionList.CANCEL) return "cancel"; if (code == ActionList.POLL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Provenance.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Provenance.java index fa0ab8aa0..ac80da341 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Provenance.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Provenance.java @@ -203,6 +203,8 @@ public class Provenance extends DomainResource { } public String toCode(ProvenanceEntityRole code) { + if (code == null) + return null; if (code == ProvenanceEntityRole.DERIVATION) return "derivation"; if (code == ProvenanceEntityRole.REVISION) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Quantity.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Quantity.java index 13456d956..bc718e475 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Quantity.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Quantity.java @@ -188,6 +188,8 @@ public class Quantity extends Type implements ICompositeType { } public String toCode(QuantityComparator code) { + if (code == null) + return null; if (code == QuantityComparator.LESS_THAN) return "<"; if (code == QuantityComparator.LESS_OR_EQUAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Questionnaire.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Questionnaire.java index 7b39a3c06..e5a49d20c 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Questionnaire.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Questionnaire.java @@ -172,6 +172,8 @@ public class Questionnaire extends DomainResource { } public String toCode(QuestionnaireStatus code) { + if (code == null) + return null; if (code == QuestionnaireStatus.DRAFT) return "draft"; if (code == QuestionnaireStatus.PUBLISHED) @@ -521,6 +523,8 @@ public class Questionnaire extends DomainResource { } public String toCode(AnswerFormat code) { + if (code == null) + return null; if (code == AnswerFormat.BOOLEAN) return "boolean"; if (code == AnswerFormat.DECIMAL) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/QuestionnaireResponse.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/QuestionnaireResponse.java index a80bbc26e..2f6b0e856 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/QuestionnaireResponse.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/QuestionnaireResponse.java @@ -175,6 +175,8 @@ public class QuestionnaireResponse extends DomainResource { } public String toCode(QuestionnaireResponseStatus code) { + if (code == null) + return null; if (code == QuestionnaireResponseStatus.INPROGRESS) return "in-progress"; if (code == QuestionnaireResponseStatus.COMPLETED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ReferralRequest.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ReferralRequest.java index 7fb07c3e4..6beffdfd3 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ReferralRequest.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ReferralRequest.java @@ -244,6 +244,8 @@ public class ReferralRequest extends DomainResource { } public String toCode(ReferralStatus code) { + if (code == null) + return null; if (code == ReferralStatus.DRAFT) return "draft"; if (code == ReferralStatus.REQUESTED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SearchParameter.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SearchParameter.java index 79d17db81..065d4b732 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SearchParameter.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SearchParameter.java @@ -215,6 +215,8 @@ public class SearchParameter extends DomainResource { } public String toCode(XPathUsageType code) { + if (code == null) + return null; if (code == XPathUsageType.NORMAL) return "normal"; if (code == XPathUsageType.PHONETIC) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Slot.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Slot.java index 2894bb67f..411e8a87a 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Slot.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Slot.java @@ -189,6 +189,8 @@ public class Slot extends DomainResource { } public String toCode(SlotStatus code) { + if (code == null) + return null; if (code == SlotStatus.BUSY) return "busy"; if (code == SlotStatus.FREE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Specimen.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Specimen.java index 4b5f3f004..406c32b01 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Specimen.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Specimen.java @@ -190,6 +190,8 @@ public class Specimen extends DomainResource { } public String toCode(SpecimenStatus code) { + if (code == null) + return null; if (code == SpecimenStatus.AVAILABLE) return "available"; if (code == SpecimenStatus.UNAVAILABLE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/StructureDefinition.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/StructureDefinition.java index fc3287603..f41294cbf 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/StructureDefinition.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/StructureDefinition.java @@ -177,6 +177,8 @@ public class StructureDefinition extends DomainResource { } public String toCode(StructureDefinitionKind code) { + if (code == null) + return null; if (code == StructureDefinitionKind.DATATYPE) return "datatype"; if (code == StructureDefinitionKind.RESOURCE) @@ -332,6 +334,8 @@ public class StructureDefinition extends DomainResource { } public String toCode(ExtensionContext code) { + if (code == null) + return null; if (code == ExtensionContext.RESOURCE) return "resource"; if (code == ExtensionContext.DATATYPE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Subscription.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Subscription.java index e86d0ab21..48a16bc52 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Subscription.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Subscription.java @@ -193,6 +193,8 @@ public class Subscription extends DomainResource { } public String toCode(SubscriptionStatus code) { + if (code == null) + return null; if (code == SubscriptionStatus.REQUESTED) return "requested"; if (code == SubscriptionStatus.ACTIVE) @@ -369,6 +371,8 @@ public class Subscription extends DomainResource { } public String toCode(SubscriptionChannelType code) { + if (code == null) + return null; if (code == SubscriptionChannelType.RESTHOOK) return "rest-hook"; if (code == SubscriptionChannelType.WEBSOCKET) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SupplyDelivery.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SupplyDelivery.java index 60c00628b..268e8f4e2 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SupplyDelivery.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SupplyDelivery.java @@ -167,6 +167,8 @@ public class SupplyDelivery extends DomainResource { } public String toCode(SupplyDeliveryStatus code) { + if (code == null) + return null; if (code == SupplyDeliveryStatus.INPROGRESS) return "in-progress"; if (code == SupplyDeliveryStatus.COMPLETED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SupplyRequest.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SupplyRequest.java index 02be99fdb..a44ae2cde 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SupplyRequest.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/SupplyRequest.java @@ -189,6 +189,8 @@ public class SupplyRequest extends DomainResource { } public String toCode(SupplyRequestStatus code) { + if (code == null) + return null; if (code == SupplyRequestStatus.REQUESTED) return "requested"; if (code == SupplyRequestStatus.COMPLETED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/TestScript.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/TestScript.java index 6aecab53a..9425df5fd 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/TestScript.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/TestScript.java @@ -155,6 +155,8 @@ public class TestScript extends DomainResource { } public String toCode(ContentType code) { + if (code == null) + return null; if (code == ContentType.XML) return "xml"; if (code == ContentType.JSON) @@ -266,6 +268,8 @@ public class TestScript extends DomainResource { } public String toCode(AssertionDirectionType code) { + if (code == null) + return null; if (code == AssertionDirectionType.RESPONSE) return "response"; if (code == AssertionDirectionType.REQUEST) @@ -521,6 +525,8 @@ public class TestScript extends DomainResource { } public String toCode(AssertionOperatorType code) { + if (code == null) + return null; if (code == AssertionOperatorType.EQUALS) return "equals"; if (code == AssertionOperatorType.NOTEQUALS) @@ -828,6 +834,8 @@ public class TestScript extends DomainResource { } public String toCode(AssertionResponseTypes code) { + if (code == null) + return null; if (code == AssertionResponseTypes.OKAY) return "okay"; if (code == AssertionResponseTypes.CREATED) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Timing.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Timing.java index ae5140f25..bbc13e4b3 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Timing.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/Timing.java @@ -246,6 +246,8 @@ public class Timing extends Type implements ICompositeType { } public String toCode(UnitsOfTime code) { + if (code == null) + return null; if (code == UnitsOfTime.S) return "s"; if (code == UnitsOfTime.MIN) @@ -583,6 +585,8 @@ public class Timing extends Type implements ICompositeType { } public String toCode(EventTiming code) { + if (code == null) + return null; if (code == EventTiming.HS) return "HS"; if (code == EventTiming.WAKE) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ValueSet.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ValueSet.java index 61e30ae0a..dfdd5e4cf 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ValueSet.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/ValueSet.java @@ -231,6 +231,8 @@ public class ValueSet extends DomainResource { } public String toCode(FilterOperator code) { + if (code == null) + return null; if (code == FilterOperator.EQUAL) return "="; if (code == FilterOperator.ISA) diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/VisionPrescription.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/VisionPrescription.java index 95231b73d..f5ba026c2 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/VisionPrescription.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/model/VisionPrescription.java @@ -155,6 +155,8 @@ public class VisionPrescription extends DomainResource { } public String toCode(VisionEyes code) { + if (code == null) + return null; if (code == VisionEyes.RIGHT) return "right"; if (code == VisionEyes.LEFT) @@ -302,6 +304,8 @@ public class VisionPrescription extends DomainResource { } public String toCode(VisionBase code) { + if (code == null) + return null; if (code == VisionBase.UP) return "up"; if (code == VisionBase.DOWN)