Return null for all toCode enum params that are null

This commit is contained in:
dotasek 2024-07-18 18:42:57 -04:00
parent 0b10290f0f
commit 97a61b2ff9
74 changed files with 289 additions and 1 deletions

View File

@ -151,6 +151,8 @@ public class Account extends DomainResource {
} }
public String toCode(AccountStatus code) { public String toCode(AccountStatus code) {
if (code == null)
return null;
if (code == AccountStatus.ACTIVE) if (code == AccountStatus.ACTIVE)
return "active"; return "active";
if (code == AccountStatus.INACTIVE) if (code == AccountStatus.INACTIVE)

View File

@ -189,6 +189,8 @@ public class Address extends Type implements ICompositeType {
} }
public String toCode(AddressUse code) { public String toCode(AddressUse code) {
if (code == null)
return null;
if (code == AddressUse.HOME) if (code == AddressUse.HOME)
return "home"; return "home";
if (code == AddressUse.WORK) if (code == AddressUse.WORK)
@ -322,6 +324,8 @@ public class Address extends Type implements ICompositeType {
} }
public String toCode(AddressType code) { public String toCode(AddressType code) {
if (code == null)
return null;
if (code == AddressType.POSTAL) if (code == AddressType.POSTAL)
return "postal"; return "postal";
if (code == AddressType.PHYSICAL) if (code == AddressType.PHYSICAL)

View File

@ -249,6 +249,8 @@ public class AllergyIntolerance extends DomainResource {
} }
public String toCode(AllergyIntoleranceStatus code) { public String toCode(AllergyIntoleranceStatus code) {
if (code == null)
return null;
if (code == AllergyIntoleranceStatus.ACTIVE) if (code == AllergyIntoleranceStatus.ACTIVE)
return "active"; return "active";
if (code == AllergyIntoleranceStatus.UNCONFIRMED) if (code == AllergyIntoleranceStatus.UNCONFIRMED)
@ -395,6 +397,8 @@ public class AllergyIntolerance extends DomainResource {
} }
public String toCode(AllergyIntoleranceCriticality code) { public String toCode(AllergyIntoleranceCriticality code) {
if (code == null)
return null;
if (code == AllergyIntoleranceCriticality.CRITL) if (code == AllergyIntoleranceCriticality.CRITL)
return "CRITL"; return "CRITL";
if (code == AllergyIntoleranceCriticality.CRITH) if (code == AllergyIntoleranceCriticality.CRITH)
@ -514,6 +518,8 @@ public class AllergyIntolerance extends DomainResource {
} }
public String toCode(AllergyIntoleranceType code) { public String toCode(AllergyIntoleranceType code) {
if (code == null)
return null;
if (code == AllergyIntoleranceType.ALLERGY) if (code == AllergyIntoleranceType.ALLERGY)
return "allergy"; return "allergy";
if (code == AllergyIntoleranceType.INTOLERANCE) if (code == AllergyIntoleranceType.INTOLERANCE)
@ -661,6 +667,8 @@ public class AllergyIntolerance extends DomainResource {
} }
public String toCode(AllergyIntoleranceCategory code) { public String toCode(AllergyIntoleranceCategory code) {
if (code == null)
return null;
if (code == AllergyIntoleranceCategory.FOOD) if (code == AllergyIntoleranceCategory.FOOD)
return "food"; return "food";
if (code == AllergyIntoleranceCategory.MEDICATION) if (code == AllergyIntoleranceCategory.MEDICATION)
@ -798,6 +806,8 @@ public class AllergyIntolerance extends DomainResource {
} }
public String toCode(AllergyIntoleranceCertainty code) { public String toCode(AllergyIntoleranceCertainty code) {
if (code == null)
return null;
if (code == AllergyIntoleranceCertainty.UNLIKELY) if (code == AllergyIntoleranceCertainty.UNLIKELY)
return "unlikely"; return "unlikely";
if (code == AllergyIntoleranceCertainty.LIKELY) if (code == AllergyIntoleranceCertainty.LIKELY)
@ -929,6 +939,8 @@ public class AllergyIntolerance extends DomainResource {
} }
public String toCode(AllergyIntoleranceSeverity code) { public String toCode(AllergyIntoleranceSeverity code) {
if (code == null)
return null;
if (code == AllergyIntoleranceSeverity.MILD) if (code == AllergyIntoleranceSeverity.MILD)
return "mild"; return "mild";
if (code == AllergyIntoleranceSeverity.MODERATE) if (code == AllergyIntoleranceSeverity.MODERATE)

View File

@ -248,6 +248,8 @@ public class Appointment extends DomainResource {
} }
public String toCode(AppointmentStatus code) { public String toCode(AppointmentStatus code) {
if (code == null)
return null;
if (code == AppointmentStatus.PROPOSED) if (code == AppointmentStatus.PROPOSED)
return "proposed"; return "proposed";
if (code == AppointmentStatus.PENDING) if (code == AppointmentStatus.PENDING)
@ -389,6 +391,8 @@ public class Appointment extends DomainResource {
} }
public String toCode(ParticipantRequired code) { public String toCode(ParticipantRequired code) {
if (code == null)
return null;
if (code == ParticipantRequired.REQUIRED) if (code == ParticipantRequired.REQUIRED)
return "required"; return "required";
if (code == ParticipantRequired.OPTIONAL) if (code == ParticipantRequired.OPTIONAL)
@ -542,6 +546,8 @@ public class Appointment extends DomainResource {
} }
public String toCode(ParticipationStatus code) { public String toCode(ParticipationStatus code) {
if (code == null)
return null;
if (code == ParticipationStatus.ACCEPTED) if (code == ParticipationStatus.ACCEPTED)
return "accepted"; return "accepted";
if (code == ParticipationStatus.DECLINED) if (code == ParticipationStatus.DECLINED)

View File

@ -225,6 +225,8 @@ public class AppointmentResponse extends DomainResource {
} }
public String toCode(ParticipantStatus code) { public String toCode(ParticipantStatus code) {
if (code == null)
return null;
if (code == ParticipantStatus.ACCEPTED) if (code == ParticipantStatus.ACCEPTED)
return "accepted"; return "accepted";
if (code == ParticipantStatus.DECLINED) if (code == ParticipantStatus.DECLINED)

View File

@ -209,6 +209,8 @@ public class AuditEvent extends DomainResource {
} }
public String toCode(AuditEventAction code) { public String toCode(AuditEventAction code) {
if (code == null)
return null;
if (code == AuditEventAction.C) if (code == AuditEventAction.C)
return "C"; return "C";
if (code == AuditEventAction.R) if (code == AuditEventAction.R)
@ -365,6 +367,8 @@ public class AuditEvent extends DomainResource {
} }
public String toCode(AuditEventOutcome code) { public String toCode(AuditEventOutcome code) {
if (code == null)
return null;
if (code == AuditEventOutcome._0) if (code == AuditEventOutcome._0)
return "0"; return "0";
if (code == AuditEventOutcome._4) if (code == AuditEventOutcome._4)
@ -497,7 +501,7 @@ public class AuditEvent extends DomainResource {
} }
public static class AuditEventParticipantNetworkTypeEnumFactory public static class AuditEventParticipantNetworkTypeEnumFactory
implements EnumFactory<AuditEventParticipantNetworkType> { implements EnumFactory<AuditEventParticipantNetworkType> {
public AuditEventParticipantNetworkType fromCode(String codeString) throws IllegalArgumentException { public AuditEventParticipantNetworkType fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString))
@ -535,6 +539,8 @@ public class AuditEvent extends DomainResource {
} }
public String toCode(AuditEventParticipantNetworkType code) { public String toCode(AuditEventParticipantNetworkType code) {
if (code == null)
return null;
if (code == AuditEventParticipantNetworkType._1) if (code == AuditEventParticipantNetworkType._1)
return "1"; return "1";
if (code == AuditEventParticipantNetworkType._2) if (code == AuditEventParticipantNetworkType._2)

View File

@ -287,6 +287,8 @@ public class Bundle extends Resource implements IBaseBundle {
} }
public String toCode(BundleType code) { public String toCode(BundleType code) {
if (code == null)
return null;
if (code == BundleType.DOCUMENT) if (code == BundleType.DOCUMENT)
return "document"; return "document";
if (code == BundleType.MESSAGE) if (code == BundleType.MESSAGE)
@ -432,6 +434,8 @@ public class Bundle extends Resource implements IBaseBundle {
} }
public String toCode(SearchEntryMode code) { public String toCode(SearchEntryMode code) {
if (code == null)
return null;
if (code == SearchEntryMode.MATCH) if (code == SearchEntryMode.MATCH)
return "match"; return "match";
if (code == SearchEntryMode.INCLUDE) if (code == SearchEntryMode.INCLUDE)
@ -581,6 +585,8 @@ public class Bundle extends Resource implements IBaseBundle {
} }
public String toCode(HTTPVerb code) { public String toCode(HTTPVerb code) {
if (code == null)
return null;
if (code == HTTPVerb.GET) if (code == HTTPVerb.GET)
return "GET"; return "GET";
if (code == HTTPVerb.POST) if (code == HTTPVerb.POST)

View File

@ -211,6 +211,8 @@ public class CarePlan extends DomainResource {
} }
public String toCode(CarePlanStatus code) { public String toCode(CarePlanStatus code) {
if (code == null)
return null;
if (code == CarePlanStatus.PROPOSED) if (code == CarePlanStatus.PROPOSED)
return "proposed"; return "proposed";
if (code == CarePlanStatus.DRAFT) if (code == CarePlanStatus.DRAFT)
@ -347,6 +349,8 @@ public class CarePlan extends DomainResource {
} }
public String toCode(CarePlanRelationship code) { public String toCode(CarePlanRelationship code) {
if (code == null)
return null;
if (code == CarePlanRelationship.INCLUDES) if (code == CarePlanRelationship.INCLUDES)
return "includes"; return "includes";
if (code == CarePlanRelationship.REPLACES) if (code == CarePlanRelationship.REPLACES)
@ -534,6 +538,8 @@ public class CarePlan extends DomainResource {
} }
public String toCode(CarePlanActivityStatus code) { public String toCode(CarePlanActivityStatus code) {
if (code == null)
return null;
if (code == CarePlanActivityStatus.NOTSTARTED) if (code == CarePlanActivityStatus.NOTSTARTED)
return "not-started"; return "not-started";
if (code == CarePlanActivityStatus.SCHEDULED) if (code == CarePlanActivityStatus.SCHEDULED)

View File

@ -210,6 +210,8 @@ public class Claim extends DomainResource {
} }
public String toCode(ClaimType code) { public String toCode(ClaimType code) {
if (code == null)
return null;
if (code == ClaimType.INSTITUTIONAL) if (code == ClaimType.INSTITUTIONAL)
return "institutional"; return "institutional";
if (code == ClaimType.ORAL) if (code == ClaimType.ORAL)
@ -365,6 +367,8 @@ public class Claim extends DomainResource {
} }
public String toCode(Use code) { public String toCode(Use code) {
if (code == null)
return null;
if (code == Use.COMPLETE) if (code == Use.COMPLETE)
return "complete"; return "complete";
if (code == Use.PROPOSED) if (code == Use.PROPOSED)

View File

@ -177,6 +177,8 @@ public class ClinicalImpression extends DomainResource {
} }
public String toCode(ClinicalImpressionStatus code) { public String toCode(ClinicalImpressionStatus code) {
if (code == null)
return null;
if (code == ClinicalImpressionStatus.INPROGRESS) if (code == ClinicalImpressionStatus.INPROGRESS)
return "in-progress"; return "in-progress";
if (code == ClinicalImpressionStatus.COMPLETED) if (code == ClinicalImpressionStatus.COMPLETED)

View File

@ -209,6 +209,8 @@ public class Communication extends DomainResource {
} }
public String toCode(CommunicationStatus code) { public String toCode(CommunicationStatus code) {
if (code == null)
return null;
if (code == CommunicationStatus.INPROGRESS) if (code == CommunicationStatus.INPROGRESS)
return "in-progress"; return "in-progress";
if (code == CommunicationStatus.COMPLETED) if (code == CommunicationStatus.COMPLETED)

View File

@ -300,6 +300,8 @@ public class CommunicationRequest extends DomainResource {
} }
public String toCode(CommunicationRequestStatus code) { public String toCode(CommunicationRequestStatus code) {
if (code == null)
return null;
if (code == CommunicationRequestStatus.PROPOSED) if (code == CommunicationRequestStatus.PROPOSED)
return "proposed"; return "proposed";
if (code == CommunicationRequestStatus.PLANNED) if (code == CommunicationRequestStatus.PLANNED)

View File

@ -201,6 +201,8 @@ public class Composition extends DomainResource {
} }
public String toCode(CompositionStatus code) { public String toCode(CompositionStatus code) {
if (code == null)
return null;
if (code == CompositionStatus.PRELIMINARY) if (code == CompositionStatus.PRELIMINARY)
return "preliminary"; return "preliminary";
if (code == CompositionStatus.FINAL) if (code == CompositionStatus.FINAL)
@ -354,6 +356,8 @@ public class Composition extends DomainResource {
} }
public String toCode(CompositionAttestationMode code) { public String toCode(CompositionAttestationMode code) {
if (code == null)
return null;
if (code == CompositionAttestationMode.PERSONAL) if (code == CompositionAttestationMode.PERSONAL)
return "personal"; return "personal";
if (code == CompositionAttestationMode.PROFESSIONAL) if (code == CompositionAttestationMode.PROFESSIONAL)

View File

@ -232,6 +232,8 @@ public class Condition extends DomainResource {
} }
public String toCode(ConditionVerificationStatus code) { public String toCode(ConditionVerificationStatus code) {
if (code == null)
return null;
if (code == ConditionVerificationStatus.PROVISIONAL) if (code == ConditionVerificationStatus.PROVISIONAL)
return "provisional"; return "provisional";
if (code == ConditionVerificationStatus.DIFFERENTIAL) if (code == ConditionVerificationStatus.DIFFERENTIAL)

View File

@ -181,6 +181,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(ConformanceStatementKind code) { public String toCode(ConformanceStatementKind code) {
if (code == null)
return null;
if (code == ConformanceStatementKind.INSTANCE) if (code == ConformanceStatementKind.INSTANCE)
return "instance"; return "instance";
if (code == ConformanceStatementKind.CAPABILITY) if (code == ConformanceStatementKind.CAPABILITY)
@ -330,6 +332,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(UnknownContentCode code) { public String toCode(UnknownContentCode code) {
if (code == null)
return null;
if (code == UnknownContentCode.NO) if (code == UnknownContentCode.NO)
return "no"; return "no";
if (code == UnknownContentCode.EXTENSIONS) if (code == UnknownContentCode.EXTENSIONS)
@ -445,6 +449,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(RestfulConformanceMode code) { public String toCode(RestfulConformanceMode code) {
if (code == null)
return null;
if (code == RestfulConformanceMode.CLIENT) if (code == RestfulConformanceMode.CLIENT)
return "client"; return "client";
if (code == RestfulConformanceMode.SERVER) if (code == RestfulConformanceMode.SERVER)
@ -682,6 +688,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(TypeRestfulInteraction code) { public String toCode(TypeRestfulInteraction code) {
if (code == null)
return null;
if (code == TypeRestfulInteraction.READ) if (code == TypeRestfulInteraction.READ)
return "read"; return "read";
if (code == TypeRestfulInteraction.VREAD) if (code == TypeRestfulInteraction.VREAD)
@ -826,6 +834,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(ResourceVersionPolicy code) { public String toCode(ResourceVersionPolicy code) {
if (code == null)
return null;
if (code == ResourceVersionPolicy.NOVERSION) if (code == ResourceVersionPolicy.NOVERSION)
return "no-version"; return "no-version";
if (code == ResourceVersionPolicy.VERSIONED) if (code == ResourceVersionPolicy.VERSIONED)
@ -958,6 +968,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(ConditionalDeleteStatus code) { public String toCode(ConditionalDeleteStatus code) {
if (code == null)
return null;
if (code == ConditionalDeleteStatus.NOTSUPPORTED) if (code == ConditionalDeleteStatus.NOTSUPPORTED)
return "not-supported"; return "not-supported";
if (code == ConditionalDeleteStatus.SINGLE) if (code == ConditionalDeleteStatus.SINGLE)
@ -1226,6 +1238,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(SearchModifierCode code) { public String toCode(SearchModifierCode code) {
if (code == null)
return null;
if (code == SearchModifierCode.MISSING) if (code == SearchModifierCode.MISSING)
return "missing"; return "missing";
if (code == SearchModifierCode.EXACT) if (code == SearchModifierCode.EXACT)
@ -1371,6 +1385,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(SystemRestfulInteraction code) { public String toCode(SystemRestfulInteraction code) {
if (code == null)
return null;
if (code == SystemRestfulInteraction.TRANSACTION) if (code == SystemRestfulInteraction.TRANSACTION)
return "transaction"; return "transaction";
if (code == SystemRestfulInteraction.SEARCHSYSTEM) if (code == SystemRestfulInteraction.SEARCHSYSTEM)
@ -1520,6 +1536,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(TransactionMode code) { public String toCode(TransactionMode code) {
if (code == null)
return null;
if (code == TransactionMode.NOTSUPPORTED) if (code == TransactionMode.NOTSUPPORTED)
return "not-supported"; return "not-supported";
if (code == TransactionMode.BATCH) if (code == TransactionMode.BATCH)
@ -1657,6 +1675,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(MessageSignificanceCategory code) { public String toCode(MessageSignificanceCategory code) {
if (code == null)
return null;
if (code == MessageSignificanceCategory.CONSEQUENCE) if (code == MessageSignificanceCategory.CONSEQUENCE)
return "Consequence"; return "Consequence";
if (code == MessageSignificanceCategory.CURRENCY) if (code == MessageSignificanceCategory.CURRENCY)
@ -1770,6 +1790,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(ConformanceEventMode code) { public String toCode(ConformanceEventMode code) {
if (code == null)
return null;
if (code == ConformanceEventMode.SENDER) if (code == ConformanceEventMode.SENDER)
return "sender"; return "sender";
if (code == ConformanceEventMode.RECEIVER) if (code == ConformanceEventMode.RECEIVER)
@ -1881,6 +1903,8 @@ public class Conformance extends DomainResource implements IBaseConformance {
} }
public String toCode(DocumentMode code) { public String toCode(DocumentMode code) {
if (code == null)
return null;
if (code == DocumentMode.PRODUCER) if (code == DocumentMode.PRODUCER)
return "producer"; return "producer";
if (code == DocumentMode.CONSUMER) if (code == DocumentMode.CONSUMER)

View File

@ -210,6 +210,8 @@ public class ContactPoint extends Type implements ICompositeType {
} }
public String toCode(ContactPointSystem code) { public String toCode(ContactPointSystem code) {
if (code == null)
return null;
if (code == ContactPointSystem.PHONE) if (code == ContactPointSystem.PHONE)
return "phone"; return "phone";
if (code == ContactPointSystem.FAX) if (code == ContactPointSystem.FAX)
@ -388,6 +390,8 @@ public class ContactPoint extends Type implements ICompositeType {
} }
public String toCode(ContactPointUse code) { public String toCode(ContactPointUse code) {
if (code == null)
return null;
if (code == ContactPointUse.HOME) if (code == ContactPointUse.HOME)
return "home"; return "home";
if (code == ContactPointUse.WORK) if (code == ContactPointUse.WORK)

View File

@ -239,6 +239,8 @@ public class DataElement extends DomainResource {
} }
public String toCode(DataElementStringency code) { public String toCode(DataElementStringency code) {
if (code == null)
return null;
if (code == DataElementStringency.COMPARABLE) if (code == DataElementStringency.COMPARABLE)
return "comparable"; return "comparable";
if (code == DataElementStringency.FULLYSPECIFIED) if (code == DataElementStringency.FULLYSPECIFIED)

View File

@ -176,6 +176,8 @@ public class DetectedIssue extends DomainResource {
} }
public String toCode(DetectedIssueSeverity code) { public String toCode(DetectedIssueSeverity code) {
if (code == null)
return null;
if (code == DetectedIssueSeverity.HIGH) if (code == DetectedIssueSeverity.HIGH)
return "high"; return "high";
if (code == DetectedIssueSeverity.MODERATE) if (code == DetectedIssueSeverity.MODERATE)

View File

@ -174,6 +174,8 @@ public class Device extends DomainResource {
} }
public String toCode(DeviceStatus code) { public String toCode(DeviceStatus code) {
if (code == null)
return null;
if (code == DeviceStatus.AVAILABLE) if (code == DeviceStatus.AVAILABLE)
return "available"; return "available";
if (code == DeviceStatus.NOTAVAILABLE) if (code == DeviceStatus.NOTAVAILABLE)

View File

@ -315,6 +315,8 @@ public class DeviceComponent extends DomainResource {
} }
public String toCode(MeasmntPrinciple code) { public String toCode(MeasmntPrinciple code) {
if (code == null)
return null;
if (code == MeasmntPrinciple.OTHER) if (code == MeasmntPrinciple.OTHER)
return "other"; return "other";
if (code == MeasmntPrinciple.CHEMICAL) if (code == MeasmntPrinciple.CHEMICAL)

View File

@ -170,6 +170,8 @@ public class DeviceMetric extends DomainResource {
} }
public String toCode(DeviceMetricOperationalStatus code) { public String toCode(DeviceMetricOperationalStatus code) {
if (code == null)
return null;
if (code == DeviceMetricOperationalStatus.ON) if (code == DeviceMetricOperationalStatus.ON)
return "on"; return "on";
if (code == DeviceMetricOperationalStatus.OFF) if (code == DeviceMetricOperationalStatus.OFF)
@ -391,6 +393,8 @@ public class DeviceMetric extends DomainResource {
} }
public String toCode(DeviceMetricColor code) { public String toCode(DeviceMetricColor code) {
if (code == null)
return null;
if (code == DeviceMetricColor.BLACK) if (code == DeviceMetricColor.BLACK)
return "black"; return "black";
if (code == DeviceMetricColor.RED) if (code == DeviceMetricColor.RED)
@ -551,6 +555,8 @@ public class DeviceMetric extends DomainResource {
} }
public String toCode(DeviceMetricCategory code) { public String toCode(DeviceMetricCategory code) {
if (code == null)
return null;
if (code == DeviceMetricCategory.MEASUREMENT) if (code == DeviceMetricCategory.MEASUREMENT)
return "measurement"; return "measurement";
if (code == DeviceMetricCategory.SETTING) if (code == DeviceMetricCategory.SETTING)
@ -702,6 +708,8 @@ public class DeviceMetric extends DomainResource {
} }
public String toCode(DeviceMetricCalibrationType code) { public String toCode(DeviceMetricCalibrationType code) {
if (code == null)
return null;
if (code == DeviceMetricCalibrationType.UNSPECIFIED) if (code == DeviceMetricCalibrationType.UNSPECIFIED)
return "unspecified"; return "unspecified";
if (code == DeviceMetricCalibrationType.OFFSET) if (code == DeviceMetricCalibrationType.OFFSET)
@ -853,6 +861,8 @@ public class DeviceMetric extends DomainResource {
} }
public String toCode(DeviceMetricCalibrationState code) { public String toCode(DeviceMetricCalibrationState code) {
if (code == null)
return null;
if (code == DeviceMetricCalibrationState.NOTCALIBRATED) if (code == DeviceMetricCalibrationState.NOTCALIBRATED)
return "not-calibrated"; return "not-calibrated";
if (code == DeviceMetricCalibrationState.CALIBRATIONREQUIRED) if (code == DeviceMetricCalibrationState.CALIBRATIONREQUIRED)

View File

@ -297,6 +297,8 @@ public class DeviceUseRequest extends DomainResource {
} }
public String toCode(DeviceUseRequestStatus code) { public String toCode(DeviceUseRequestStatus code) {
if (code == null)
return null;
if (code == DeviceUseRequestStatus.PROPOSED) if (code == DeviceUseRequestStatus.PROPOSED)
return "proposed"; return "proposed";
if (code == DeviceUseRequestStatus.PLANNED) if (code == DeviceUseRequestStatus.PLANNED)
@ -460,6 +462,8 @@ public class DeviceUseRequest extends DomainResource {
} }
public String toCode(DeviceUseRequestPriority code) { public String toCode(DeviceUseRequestPriority code) {
if (code == null)
return null;
if (code == DeviceUseRequestPriority.ROUTINE) if (code == DeviceUseRequestPriority.ROUTINE)
return "routine"; return "routine";
if (code == DeviceUseRequestPriority.URGENT) if (code == DeviceUseRequestPriority.URGENT)

View File

@ -352,6 +352,8 @@ public class DiagnosticOrder extends DomainResource {
} }
public String toCode(DiagnosticOrderStatus code) { public String toCode(DiagnosticOrderStatus code) {
if (code == null)
return null;
if (code == DiagnosticOrderStatus.PROPOSED) if (code == DiagnosticOrderStatus.PROPOSED)
return "proposed"; return "proposed";
if (code == DiagnosticOrderStatus.DRAFT) if (code == DiagnosticOrderStatus.DRAFT)
@ -521,6 +523,8 @@ public class DiagnosticOrder extends DomainResource {
} }
public String toCode(DiagnosticOrderPriority code) { public String toCode(DiagnosticOrderPriority code) {
if (code == null)
return null;
if (code == DiagnosticOrderPriority.ROUTINE) if (code == DiagnosticOrderPriority.ROUTINE)
return "routine"; return "routine";
if (code == DiagnosticOrderPriority.URGENT) if (code == DiagnosticOrderPriority.URGENT)

View File

@ -253,6 +253,8 @@ public class DiagnosticReport extends DomainResource {
} }
public String toCode(DiagnosticReportStatus code) { public String toCode(DiagnosticReportStatus code) {
if (code == null)
return null;
if (code == DiagnosticReportStatus.REGISTERED) if (code == DiagnosticReportStatus.REGISTERED)
return "registered"; return "registered";
if (code == DiagnosticReportStatus.PARTIAL) if (code == DiagnosticReportStatus.PARTIAL)

View File

@ -191,6 +191,8 @@ public class DocumentReference extends DomainResource {
} }
public String toCode(DocumentRelationshipType code) { public String toCode(DocumentRelationshipType code) {
if (code == null)
return null;
if (code == DocumentRelationshipType.REPLACES) if (code == DocumentRelationshipType.REPLACES)
return "replaces"; return "replaces";
if (code == DocumentRelationshipType.TRANSFORMS) if (code == DocumentRelationshipType.TRANSFORMS)

View File

@ -136,6 +136,8 @@ public class ElementDefinition extends Type implements ICompositeType {
} }
public String toCode(PropertyRepresentation code) { public String toCode(PropertyRepresentation code) {
if (code == null)
return null;
if (code == PropertyRepresentation.XMLATTR) if (code == PropertyRepresentation.XMLATTR)
return "xmlAttr"; return "xmlAttr";
return "?"; return "?";
@ -266,6 +268,8 @@ public class ElementDefinition extends Type implements ICompositeType {
} }
public String toCode(SlicingRules code) { public String toCode(SlicingRules code) {
if (code == null)
return null;
if (code == SlicingRules.CLOSED) if (code == SlicingRules.CLOSED)
return "closed"; return "closed";
if (code == SlicingRules.OPEN) if (code == SlicingRules.OPEN)
@ -399,6 +403,8 @@ public class ElementDefinition extends Type implements ICompositeType {
} }
public String toCode(AggregationMode code) { public String toCode(AggregationMode code) {
if (code == null)
return null;
if (code == AggregationMode.CONTAINED) if (code == AggregationMode.CONTAINED)
return "contained"; return "contained";
if (code == AggregationMode.REFERENCED) if (code == AggregationMode.REFERENCED)
@ -513,6 +519,8 @@ public class ElementDefinition extends Type implements ICompositeType {
} }
public String toCode(ConstraintSeverity code) { public String toCode(ConstraintSeverity code) {
if (code == null)
return null;
if (code == ConstraintSeverity.ERROR) if (code == ConstraintSeverity.ERROR)
return "error"; return "error";
if (code == ConstraintSeverity.WARNING) if (code == ConstraintSeverity.WARNING)

View File

@ -226,6 +226,8 @@ public class Encounter extends DomainResource {
} }
public String toCode(EncounterState code) { public String toCode(EncounterState code) {
if (code == null)
return null;
if (code == EncounterState.PLANNED) if (code == EncounterState.PLANNED)
return "planned"; return "planned";
if (code == EncounterState.ARRIVED) if (code == EncounterState.ARRIVED)
@ -477,6 +479,8 @@ public class Encounter extends DomainResource {
} }
public String toCode(EncounterClass code) { public String toCode(EncounterClass code) {
if (code == null)
return null;
if (code == EncounterClass.INPATIENT) if (code == EncounterClass.INPATIENT)
return "inpatient"; return "inpatient";
if (code == EncounterClass.OUTPATIENT) if (code == EncounterClass.OUTPATIENT)
@ -645,6 +649,8 @@ public class Encounter extends DomainResource {
} }
public String toCode(EncounterLocationStatus code) { public String toCode(EncounterLocationStatus code) {
if (code == null)
return null;
if (code == EncounterLocationStatus.PLANNED) if (code == EncounterLocationStatus.PLANNED)
return "planned"; return "planned";
if (code == EncounterLocationStatus.ACTIVE) if (code == EncounterLocationStatus.ACTIVE)

View File

@ -189,6 +189,8 @@ public class Enumerations {
} }
public String toCode(AdministrativeGender code) { public String toCode(AdministrativeGender code) {
if (code == null)
return null;
if (code == AdministrativeGender.MALE) if (code == AdministrativeGender.MALE)
return "male"; return "male";
if (code == AdministrativeGender.FEMALE) if (code == AdministrativeGender.FEMALE)
@ -376,6 +378,8 @@ public class Enumerations {
} }
public String toCode(AgeUnits code) { public String toCode(AgeUnits code) {
if (code == null)
return null;
if (code == AgeUnits.MIN) if (code == AgeUnits.MIN)
return "min"; return "min";
if (code == AgeUnits.H) if (code == AgeUnits.H)
@ -540,6 +544,8 @@ public class Enumerations {
} }
public String toCode(BindingStrength code) { public String toCode(BindingStrength code) {
if (code == null)
return null;
if (code == BindingStrength.REQUIRED) if (code == BindingStrength.REQUIRED)
return "required"; return "required";
if (code == BindingStrength.EXTENSIBLE) if (code == BindingStrength.EXTENSIBLE)
@ -796,6 +802,8 @@ public class Enumerations {
} }
public String toCode(ConceptMapEquivalence code) { public String toCode(ConceptMapEquivalence code) {
if (code == null)
return null;
if (code == ConceptMapEquivalence.EQUIVALENT) if (code == ConceptMapEquivalence.EQUIVALENT)
return "equivalent"; return "equivalent";
if (code == ConceptMapEquivalence.EQUAL) if (code == ConceptMapEquivalence.EQUAL)
@ -939,6 +947,8 @@ public class Enumerations {
} }
public String toCode(ConformanceResourceStatus code) { public String toCode(ConformanceResourceStatus code) {
if (code == null)
return null;
if (code == ConformanceResourceStatus.DRAFT) if (code == ConformanceResourceStatus.DRAFT)
return "draft"; return "draft";
if (code == ConformanceResourceStatus.ACTIVE) if (code == ConformanceResourceStatus.ACTIVE)
@ -1181,6 +1191,8 @@ public class Enumerations {
} }
public String toCode(DataAbsentReason code) { public String toCode(DataAbsentReason code) {
if (code == null)
return null;
if (code == DataAbsentReason.UNKNOWN) if (code == DataAbsentReason.UNKNOWN)
return "unknown"; return "unknown";
if (code == DataAbsentReason.ASKED) if (code == DataAbsentReason.ASKED)
@ -2129,6 +2141,8 @@ public class Enumerations {
} }
public String toCode(DataType code) { public String toCode(DataType code) {
if (code == null)
return null;
if (code == DataType.ADDRESS) if (code == DataType.ADDRESS)
return "Address"; return "Address";
if (code == DataType.AGE) if (code == DataType.AGE)
@ -2346,6 +2360,8 @@ public class Enumerations {
} }
public String toCode(DocumentReferenceStatus code) { public String toCode(DocumentReferenceStatus code) {
if (code == null)
return null;
if (code == DocumentReferenceStatus.CURRENT) if (code == DocumentReferenceStatus.CURRENT)
return "current"; return "current";
if (code == DocumentReferenceStatus.SUPERSEDED) if (code == DocumentReferenceStatus.SUPERSEDED)
@ -5195,6 +5211,8 @@ public class Enumerations {
} }
public String toCode(FHIRDefinedType code) { public String toCode(FHIRDefinedType code) {
if (code == null)
return null;
if (code == FHIRDefinedType.ADDRESS) if (code == FHIRDefinedType.ADDRESS)
return "Address"; return "Address";
if (code == FHIRDefinedType.AGE) if (code == FHIRDefinedType.AGE)
@ -5738,6 +5756,8 @@ public class Enumerations {
} }
public String toCode(MessageEvent code) { public String toCode(MessageEvent code) {
if (code == null)
return null;
if (code == MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE) if (code == MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE)
return "MedicationAdministration-Complete"; return "MedicationAdministration-Complete";
if (code == MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION) if (code == MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION)
@ -5883,6 +5903,8 @@ public class Enumerations {
} }
public String toCode(NoteType code) { public String toCode(NoteType code) {
if (code == null)
return null;
if (code == NoteType.DISPLAY) if (code == NoteType.DISPLAY)
return "display"; return "display";
if (code == NoteType.PRINT) if (code == NoteType.PRINT)
@ -5996,6 +6018,8 @@ public class Enumerations {
} }
public String toCode(RemittanceOutcome code) { public String toCode(RemittanceOutcome code) {
if (code == null)
return null;
if (code == RemittanceOutcome.COMPLETE) if (code == RemittanceOutcome.COMPLETE)
return "complete"; return "complete";
if (code == RemittanceOutcome.ERROR) if (code == RemittanceOutcome.ERROR)
@ -7984,6 +8008,8 @@ public class Enumerations {
} }
public String toCode(ResourceType code) { public String toCode(ResourceType code) {
if (code == null)
return null;
if (code == ResourceType.ACCOUNT) if (code == ResourceType.ACCOUNT)
return "Account"; return "Account";
if (code == ResourceType.ALLERGYINTOLERANCE) if (code == ResourceType.ALLERGYINTOLERANCE)
@ -8398,6 +8424,8 @@ public class Enumerations {
} }
public String toCode(SearchParamType code) { public String toCode(SearchParamType code) {
if (code == null)
return null;
if (code == SearchParamType.NUMBER) if (code == SearchParamType.NUMBER)
return "number"; return "number";
if (code == SearchParamType.DATE) if (code == SearchParamType.DATE)
@ -8594,6 +8622,8 @@ public class Enumerations {
} }
public String toCode(SpecialValues code) { public String toCode(SpecialValues code) {
if (code == null)
return null;
if (code == SpecialValues.TRUE) if (code == SpecialValues.TRUE)
return "true"; return "true";
if (code == SpecialValues.FALSE) if (code == SpecialValues.FALSE)

View File

@ -235,6 +235,8 @@ public class EpisodeOfCare extends DomainResource {
} }
public String toCode(EpisodeOfCareStatus code) { public String toCode(EpisodeOfCareStatus code) {
if (code == null)
return null;
if (code == EpisodeOfCareStatus.PLANNED) if (code == EpisodeOfCareStatus.PLANNED)
return "planned"; return "planned";
if (code == EpisodeOfCareStatus.WAITLIST) if (code == EpisodeOfCareStatus.WAITLIST)

View File

@ -192,6 +192,8 @@ public class FamilyMemberHistory extends DomainResource {
} }
public String toCode(FamilyHistoryStatus code) { public String toCode(FamilyHistoryStatus code) {
if (code == null)
return null;
if (code == FamilyHistoryStatus.PARTIAL) if (code == FamilyHistoryStatus.PARTIAL)
return "partial"; return "partial";
if (code == FamilyHistoryStatus.COMPLETED) if (code == FamilyHistoryStatus.COMPLETED)

View File

@ -167,6 +167,8 @@ public class Flag extends DomainResource {
} }
public String toCode(FlagStatus code) { public String toCode(FlagStatus code) {
if (code == null)
return null;
if (code == FlagStatus.ACTIVE) if (code == FlagStatus.ACTIVE)
return "active"; return "active";
if (code == FlagStatus.INACTIVE) if (code == FlagStatus.INACTIVE)

View File

@ -284,6 +284,8 @@ public class Goal extends DomainResource {
} }
public String toCode(GoalStatus code) { public String toCode(GoalStatus code) {
if (code == null)
return null;
if (code == GoalStatus.PROPOSED) if (code == GoalStatus.PROPOSED)
return "proposed"; return "proposed";
if (code == GoalStatus.PLANNED) if (code == GoalStatus.PLANNED)

View File

@ -226,6 +226,8 @@ public class Group extends DomainResource {
} }
public String toCode(GroupType code) { public String toCode(GroupType code) {
if (code == null)
return null;
if (code == GroupType.PERSON) if (code == GroupType.PERSON)
return "person"; return "person";
if (code == GroupType.ANIMAL) if (code == GroupType.ANIMAL)

View File

@ -241,6 +241,8 @@ public class HealthcareService extends DomainResource {
} }
public String toCode(DaysOfWeek code) { public String toCode(DaysOfWeek code) {
if (code == null)
return null;
if (code == DaysOfWeek.MON) if (code == DaysOfWeek.MON)
return "mon"; return "mon";
if (code == DaysOfWeek.TUE) if (code == DaysOfWeek.TUE)

View File

@ -250,6 +250,8 @@ public class HumanName extends Type implements ICompositeType {
} }
public String toCode(NameUse code) { public String toCode(NameUse code) {
if (code == null)
return null;
if (code == NameUse.USUAL) if (code == NameUse.USUAL)
return "usual"; return "usual";
if (code == NameUse.OFFICIAL) if (code == NameUse.OFFICIAL)

View File

@ -187,6 +187,8 @@ public class Identifier extends Type implements ICompositeType {
} }
public String toCode(IdentifierUse code) { public String toCode(IdentifierUse code) {
if (code == null)
return null;
if (code == IdentifierUse.USUAL) if (code == IdentifierUse.USUAL)
return "usual"; return "usual";
if (code == IdentifierUse.OFFICIAL) if (code == IdentifierUse.OFFICIAL)

View File

@ -192,6 +192,8 @@ public class ImagingStudy extends DomainResource {
} }
public String toCode(InstanceAvailability code) { public String toCode(InstanceAvailability code) {
if (code == null)
return null;
if (code == InstanceAvailability.ONLINE) if (code == InstanceAvailability.ONLINE)
return "ONLINE"; return "ONLINE";
if (code == InstanceAvailability.OFFLINE) if (code == InstanceAvailability.OFFLINE)

View File

@ -156,6 +156,8 @@ public class ImplementationGuide extends DomainResource {
} }
public String toCode(GuideDependencyType code) { public String toCode(GuideDependencyType code) {
if (code == null)
return null;
if (code == GuideDependencyType.REFERENCE) if (code == GuideDependencyType.REFERENCE)
return "reference"; return "reference";
if (code == GuideDependencyType.INCLUSION) if (code == GuideDependencyType.INCLUSION)
@ -343,6 +345,8 @@ public class ImplementationGuide extends DomainResource {
} }
public String toCode(GuideResourcePurpose code) { public String toCode(GuideResourcePurpose code) {
if (code == null)
return null;
if (code == GuideResourcePurpose.EXAMPLE) if (code == GuideResourcePurpose.EXAMPLE)
return "example"; return "example";
if (code == GuideResourcePurpose.TERMINOLOGY) if (code == GuideResourcePurpose.TERMINOLOGY)
@ -573,6 +577,8 @@ public class ImplementationGuide extends DomainResource {
} }
public String toCode(GuidePageKind code) { public String toCode(GuidePageKind code) {
if (code == null)
return null;
if (code == GuidePageKind.PAGE) if (code == GuidePageKind.PAGE)
return "page"; return "page";
if (code == GuidePageKind.EXAMPLE) if (code == GuidePageKind.EXAMPLE)

View File

@ -170,6 +170,8 @@ public class List_ extends DomainResource {
} }
public String toCode(ListStatus code) { public String toCode(ListStatus code) {
if (code == null)
return null;
if (code == ListStatus.CURRENT) if (code == ListStatus.CURRENT)
return "current"; return "current";
if (code == ListStatus.RETIRED) if (code == ListStatus.RETIRED)
@ -302,6 +304,8 @@ public class List_ extends DomainResource {
} }
public String toCode(ListMode code) { public String toCode(ListMode code) {
if (code == null)
return null;
if (code == ListMode.WORKING) if (code == ListMode.WORKING)
return "working"; return "working";
if (code == ListMode.SNAPSHOT) if (code == ListMode.SNAPSHOT)

View File

@ -173,6 +173,8 @@ public class Location extends DomainResource {
} }
public String toCode(LocationStatus code) { public String toCode(LocationStatus code) {
if (code == null)
return null;
if (code == LocationStatus.ACTIVE) if (code == LocationStatus.ACTIVE)
return "active"; return "active";
if (code == LocationStatus.SUSPENDED) if (code == LocationStatus.SUSPENDED)
@ -289,6 +291,8 @@ public class Location extends DomainResource {
} }
public String toCode(LocationMode code) { public String toCode(LocationMode code) {
if (code == null)
return null;
if (code == LocationMode.INSTANCE) if (code == LocationMode.INSTANCE)
return "instance"; return "instance";
if (code == LocationMode.KIND) if (code == LocationMode.KIND)

View File

@ -169,6 +169,8 @@ public class Media extends DomainResource {
} }
public String toCode(DigitalMediaType code) { public String toCode(DigitalMediaType code) {
if (code == null)
return null;
if (code == DigitalMediaType.PHOTO) if (code == DigitalMediaType.PHOTO)
return "photo"; return "photo";
if (code == DigitalMediaType.VIDEO) if (code == DigitalMediaType.VIDEO)

View File

@ -211,6 +211,8 @@ public class MedicationAdministration extends DomainResource {
} }
public String toCode(MedicationAdministrationStatus code) { public String toCode(MedicationAdministrationStatus code) {
if (code == null)
return null;
if (code == MedicationAdministrationStatus.INPROGRESS) if (code == MedicationAdministrationStatus.INPROGRESS)
return "in-progress"; return "in-progress";
if (code == MedicationAdministrationStatus.ONHOLD) if (code == MedicationAdministrationStatus.ONHOLD)

View File

@ -212,6 +212,8 @@ public class MedicationDispense extends DomainResource {
} }
public String toCode(MedicationDispenseStatus code) { public String toCode(MedicationDispenseStatus code) {
if (code == null)
return null;
if (code == MedicationDispenseStatus.INPROGRESS) if (code == MedicationDispenseStatus.INPROGRESS)
return "in-progress"; return "in-progress";
if (code == MedicationDispenseStatus.ONHOLD) if (code == MedicationDispenseStatus.ONHOLD)

View File

@ -232,6 +232,8 @@ public class MedicationOrder extends DomainResource {
} }
public String toCode(MedicationOrderStatus code) { public String toCode(MedicationOrderStatus code) {
if (code == null)
return null;
if (code == MedicationOrderStatus.ACTIVE) if (code == MedicationOrderStatus.ACTIVE)
return "active"; return "active";
if (code == MedicationOrderStatus.ONHOLD) if (code == MedicationOrderStatus.ONHOLD)

View File

@ -209,6 +209,8 @@ public class MedicationStatement extends DomainResource {
} }
public String toCode(MedicationStatementStatus code) { public String toCode(MedicationStatementStatus code) {
if (code == null)
return null;
if (code == MedicationStatementStatus.ACTIVE) if (code == MedicationStatementStatus.ACTIVE)
return "active"; return "active";
if (code == MedicationStatementStatus.COMPLETED) if (code == MedicationStatementStatus.COMPLETED)

View File

@ -177,6 +177,8 @@ public class MessageHeader extends DomainResource {
} }
public String toCode(ResponseType code) { public String toCode(ResponseType code) {
if (code == null)
return null;
if (code == ResponseType.OK) if (code == ResponseType.OK)
return "ok"; return "ok";
if (code == ResponseType.TRANSIENTERROR) if (code == ResponseType.TRANSIENTERROR)

View File

@ -177,6 +177,8 @@ public class NamingSystem extends DomainResource {
} }
public String toCode(NamingSystemType code) { public String toCode(NamingSystemType code) {
if (code == null)
return null;
if (code == NamingSystemType.CODESYSTEM) if (code == NamingSystemType.CODESYSTEM)
return "codesystem"; return "codesystem";
if (code == NamingSystemType.IDENTIFIER) if (code == NamingSystemType.IDENTIFIER)
@ -329,6 +331,8 @@ public class NamingSystem extends DomainResource {
} }
public String toCode(NamingSystemIdentifierType code) { public String toCode(NamingSystemIdentifierType code) {
if (code == null)
return null;
if (code == NamingSystemIdentifierType.OID) if (code == NamingSystemIdentifierType.OID)
return "oid"; return "oid";
if (code == NamingSystemIdentifierType.UUID) if (code == NamingSystemIdentifierType.UUID)

View File

@ -188,6 +188,8 @@ public class Narrative extends BaseNarrative implements INarrative {
} }
public String toCode(NarrativeStatus code) { public String toCode(NarrativeStatus code) {
if (code == null)
return null;
if (code == NarrativeStatus.GENERATED) if (code == NarrativeStatus.GENERATED)
return "generated"; return "generated";
if (code == NarrativeStatus.EXTENSIONS) if (code == NarrativeStatus.EXTENSIONS)

View File

@ -264,6 +264,8 @@ public class NutritionOrder extends DomainResource {
} }
public String toCode(NutritionOrderStatus code) { public String toCode(NutritionOrderStatus code) {
if (code == null)
return null;
if (code == NutritionOrderStatus.PROPOSED) if (code == NutritionOrderStatus.PROPOSED)
return "proposed"; return "proposed";
if (code == NutritionOrderStatus.DRAFT) if (code == NutritionOrderStatus.DRAFT)

View File

@ -249,6 +249,8 @@ public class Observation extends DomainResource {
} }
public String toCode(ObservationStatus code) { public String toCode(ObservationStatus code) {
if (code == null)
return null;
if (code == ObservationStatus.REGISTERED) if (code == ObservationStatus.REGISTERED)
return "registered"; return "registered";
if (code == ObservationStatus.PRELIMINARY) if (code == ObservationStatus.PRELIMINARY)
@ -452,6 +454,8 @@ public class Observation extends DomainResource {
} }
public String toCode(ObservationRelationshipType code) { public String toCode(ObservationRelationshipType code) {
if (code == null)
return null;
if (code == ObservationRelationshipType.HASMEMBER) if (code == ObservationRelationshipType.HASMEMBER)
return "has-member"; return "has-member";
if (code == ObservationRelationshipType.DERIVEDFROM) if (code == ObservationRelationshipType.DERIVEDFROM)

View File

@ -157,6 +157,8 @@ public class OperationDefinition extends DomainResource {
} }
public String toCode(OperationKind code) { public String toCode(OperationKind code) {
if (code == null)
return null;
if (code == OperationKind.OPERATION) if (code == OperationKind.OPERATION)
return "operation"; return "operation";
if (code == OperationKind.QUERY) if (code == OperationKind.QUERY)
@ -268,6 +270,8 @@ public class OperationDefinition extends DomainResource {
} }
public String toCode(OperationParameterUse code) { public String toCode(OperationParameterUse code) {
if (code == null)
return null;
if (code == OperationParameterUse.IN) if (code == OperationParameterUse.IN)
return "in"; return "in";
if (code == OperationParameterUse.OUT) if (code == OperationParameterUse.OUT)

View File

@ -190,6 +190,8 @@ public class OperationOutcome extends DomainResource implements IBaseOperationOu
} }
public String toCode(IssueSeverity code) { public String toCode(IssueSeverity code) {
if (code == null)
return null;
if (code == IssueSeverity.FATAL) if (code == IssueSeverity.FATAL)
return "fatal"; return "fatal";
if (code == IssueSeverity.ERROR) if (code == IssueSeverity.ERROR)
@ -811,6 +813,8 @@ public class OperationOutcome extends DomainResource implements IBaseOperationOu
} }
public String toCode(IssueType code) { public String toCode(IssueType code) {
if (code == null)
return null;
if (code == IssueType.INVALID) if (code == IssueType.INVALID)
return "invalid"; return "invalid";
if (code == IssueType.STRUCTURE) if (code == IssueType.STRUCTURE)

View File

@ -279,6 +279,8 @@ public class OrderResponse extends DomainResource {
} }
public String toCode(OrderStatus code) { public String toCode(OrderStatus code) {
if (code == null)
return null;
if (code == OrderStatus.PENDING) if (code == OrderStatus.PENDING)
return "pending"; return "pending";
if (code == OrderStatus.REVIEW) if (code == OrderStatus.REVIEW)

View File

@ -181,6 +181,8 @@ public class Patient extends DomainResource {
} }
public String toCode(LinkType code) { public String toCode(LinkType code) {
if (code == null)
return null;
if (code == LinkType.REPLACE) if (code == LinkType.REPLACE)
return "replace"; return "replace";
if (code == LinkType.REFER) if (code == LinkType.REFER)

View File

@ -190,6 +190,8 @@ public class Person extends DomainResource {
} }
public String toCode(IdentityAssuranceLevel code) { public String toCode(IdentityAssuranceLevel code) {
if (code == null)
return null;
if (code == IdentityAssuranceLevel.LEVEL1) if (code == IdentityAssuranceLevel.LEVEL1)
return "level1"; return "level1";
if (code == IdentityAssuranceLevel.LEVEL2) if (code == IdentityAssuranceLevel.LEVEL2)

View File

@ -188,6 +188,8 @@ public class Procedure extends DomainResource {
} }
public String toCode(ProcedureStatus code) { public String toCode(ProcedureStatus code) {
if (code == null)
return null;
if (code == ProcedureStatus.INPROGRESS) if (code == ProcedureStatus.INPROGRESS)
return "in-progress"; return "in-progress";
if (code == ProcedureStatus.ABORTED) if (code == ProcedureStatus.ABORTED)

View File

@ -297,6 +297,8 @@ public class ProcedureRequest extends DomainResource {
} }
public String toCode(ProcedureRequestStatus code) { public String toCode(ProcedureRequestStatus code) {
if (code == null)
return null;
if (code == ProcedureRequestStatus.PROPOSED) if (code == ProcedureRequestStatus.PROPOSED)
return "proposed"; return "proposed";
if (code == ProcedureRequestStatus.DRAFT) if (code == ProcedureRequestStatus.DRAFT)
@ -460,6 +462,8 @@ public class ProcedureRequest extends DomainResource {
} }
public String toCode(ProcedureRequestPriority code) { public String toCode(ProcedureRequestPriority code) {
if (code == null)
return null;
if (code == ProcedureRequestPriority.ROUTINE) if (code == ProcedureRequestPriority.ROUTINE)
return "routine"; return "routine";
if (code == ProcedureRequestPriority.URGENT) if (code == ProcedureRequestPriority.URGENT)

View File

@ -189,6 +189,8 @@ public class ProcessRequest extends DomainResource {
} }
public String toCode(ActionList code) { public String toCode(ActionList code) {
if (code == null)
return null;
if (code == ActionList.CANCEL) if (code == ActionList.CANCEL)
return "cancel"; return "cancel";
if (code == ActionList.POLL) if (code == ActionList.POLL)

View File

@ -203,6 +203,8 @@ public class Provenance extends DomainResource {
} }
public String toCode(ProvenanceEntityRole code) { public String toCode(ProvenanceEntityRole code) {
if (code == null)
return null;
if (code == ProvenanceEntityRole.DERIVATION) if (code == ProvenanceEntityRole.DERIVATION)
return "derivation"; return "derivation";
if (code == ProvenanceEntityRole.REVISION) if (code == ProvenanceEntityRole.REVISION)

View File

@ -188,6 +188,8 @@ public class Quantity extends Type implements ICompositeType {
} }
public String toCode(QuantityComparator code) { public String toCode(QuantityComparator code) {
if (code == null)
return null;
if (code == QuantityComparator.LESS_THAN) if (code == QuantityComparator.LESS_THAN)
return "<"; return "<";
if (code == QuantityComparator.LESS_OR_EQUAL) if (code == QuantityComparator.LESS_OR_EQUAL)

View File

@ -172,6 +172,8 @@ public class Questionnaire extends DomainResource {
} }
public String toCode(QuestionnaireStatus code) { public String toCode(QuestionnaireStatus code) {
if (code == null)
return null;
if (code == QuestionnaireStatus.DRAFT) if (code == QuestionnaireStatus.DRAFT)
return "draft"; return "draft";
if (code == QuestionnaireStatus.PUBLISHED) if (code == QuestionnaireStatus.PUBLISHED)
@ -521,6 +523,8 @@ public class Questionnaire extends DomainResource {
} }
public String toCode(AnswerFormat code) { public String toCode(AnswerFormat code) {
if (code == null)
return null;
if (code == AnswerFormat.BOOLEAN) if (code == AnswerFormat.BOOLEAN)
return "boolean"; return "boolean";
if (code == AnswerFormat.DECIMAL) if (code == AnswerFormat.DECIMAL)

View File

@ -175,6 +175,8 @@ public class QuestionnaireResponse extends DomainResource {
} }
public String toCode(QuestionnaireResponseStatus code) { public String toCode(QuestionnaireResponseStatus code) {
if (code == null)
return null;
if (code == QuestionnaireResponseStatus.INPROGRESS) if (code == QuestionnaireResponseStatus.INPROGRESS)
return "in-progress"; return "in-progress";
if (code == QuestionnaireResponseStatus.COMPLETED) if (code == QuestionnaireResponseStatus.COMPLETED)

View File

@ -244,6 +244,8 @@ public class ReferralRequest extends DomainResource {
} }
public String toCode(ReferralStatus code) { public String toCode(ReferralStatus code) {
if (code == null)
return null;
if (code == ReferralStatus.DRAFT) if (code == ReferralStatus.DRAFT)
return "draft"; return "draft";
if (code == ReferralStatus.REQUESTED) if (code == ReferralStatus.REQUESTED)

View File

@ -215,6 +215,8 @@ public class SearchParameter extends DomainResource {
} }
public String toCode(XPathUsageType code) { public String toCode(XPathUsageType code) {
if (code == null)
return null;
if (code == XPathUsageType.NORMAL) if (code == XPathUsageType.NORMAL)
return "normal"; return "normal";
if (code == XPathUsageType.PHONETIC) if (code == XPathUsageType.PHONETIC)

View File

@ -189,6 +189,8 @@ public class Slot extends DomainResource {
} }
public String toCode(SlotStatus code) { public String toCode(SlotStatus code) {
if (code == null)
return null;
if (code == SlotStatus.BUSY) if (code == SlotStatus.BUSY)
return "busy"; return "busy";
if (code == SlotStatus.FREE) if (code == SlotStatus.FREE)

View File

@ -190,6 +190,8 @@ public class Specimen extends DomainResource {
} }
public String toCode(SpecimenStatus code) { public String toCode(SpecimenStatus code) {
if (code == null)
return null;
if (code == SpecimenStatus.AVAILABLE) if (code == SpecimenStatus.AVAILABLE)
return "available"; return "available";
if (code == SpecimenStatus.UNAVAILABLE) if (code == SpecimenStatus.UNAVAILABLE)

View File

@ -177,6 +177,8 @@ public class StructureDefinition extends DomainResource {
} }
public String toCode(StructureDefinitionKind code) { public String toCode(StructureDefinitionKind code) {
if (code == null)
return null;
if (code == StructureDefinitionKind.DATATYPE) if (code == StructureDefinitionKind.DATATYPE)
return "datatype"; return "datatype";
if (code == StructureDefinitionKind.RESOURCE) if (code == StructureDefinitionKind.RESOURCE)
@ -332,6 +334,8 @@ public class StructureDefinition extends DomainResource {
} }
public String toCode(ExtensionContext code) { public String toCode(ExtensionContext code) {
if (code == null)
return null;
if (code == ExtensionContext.RESOURCE) if (code == ExtensionContext.RESOURCE)
return "resource"; return "resource";
if (code == ExtensionContext.DATATYPE) if (code == ExtensionContext.DATATYPE)

View File

@ -193,6 +193,8 @@ public class Subscription extends DomainResource {
} }
public String toCode(SubscriptionStatus code) { public String toCode(SubscriptionStatus code) {
if (code == null)
return null;
if (code == SubscriptionStatus.REQUESTED) if (code == SubscriptionStatus.REQUESTED)
return "requested"; return "requested";
if (code == SubscriptionStatus.ACTIVE) if (code == SubscriptionStatus.ACTIVE)
@ -369,6 +371,8 @@ public class Subscription extends DomainResource {
} }
public String toCode(SubscriptionChannelType code) { public String toCode(SubscriptionChannelType code) {
if (code == null)
return null;
if (code == SubscriptionChannelType.RESTHOOK) if (code == SubscriptionChannelType.RESTHOOK)
return "rest-hook"; return "rest-hook";
if (code == SubscriptionChannelType.WEBSOCKET) if (code == SubscriptionChannelType.WEBSOCKET)

View File

@ -167,6 +167,8 @@ public class SupplyDelivery extends DomainResource {
} }
public String toCode(SupplyDeliveryStatus code) { public String toCode(SupplyDeliveryStatus code) {
if (code == null)
return null;
if (code == SupplyDeliveryStatus.INPROGRESS) if (code == SupplyDeliveryStatus.INPROGRESS)
return "in-progress"; return "in-progress";
if (code == SupplyDeliveryStatus.COMPLETED) if (code == SupplyDeliveryStatus.COMPLETED)

View File

@ -189,6 +189,8 @@ public class SupplyRequest extends DomainResource {
} }
public String toCode(SupplyRequestStatus code) { public String toCode(SupplyRequestStatus code) {
if (code == null)
return null;
if (code == SupplyRequestStatus.REQUESTED) if (code == SupplyRequestStatus.REQUESTED)
return "requested"; return "requested";
if (code == SupplyRequestStatus.COMPLETED) if (code == SupplyRequestStatus.COMPLETED)

View File

@ -155,6 +155,8 @@ public class TestScript extends DomainResource {
} }
public String toCode(ContentType code) { public String toCode(ContentType code) {
if (code == null)
return null;
if (code == ContentType.XML) if (code == ContentType.XML)
return "xml"; return "xml";
if (code == ContentType.JSON) if (code == ContentType.JSON)
@ -266,6 +268,8 @@ public class TestScript extends DomainResource {
} }
public String toCode(AssertionDirectionType code) { public String toCode(AssertionDirectionType code) {
if (code == null)
return null;
if (code == AssertionDirectionType.RESPONSE) if (code == AssertionDirectionType.RESPONSE)
return "response"; return "response";
if (code == AssertionDirectionType.REQUEST) if (code == AssertionDirectionType.REQUEST)
@ -521,6 +525,8 @@ public class TestScript extends DomainResource {
} }
public String toCode(AssertionOperatorType code) { public String toCode(AssertionOperatorType code) {
if (code == null)
return null;
if (code == AssertionOperatorType.EQUALS) if (code == AssertionOperatorType.EQUALS)
return "equals"; return "equals";
if (code == AssertionOperatorType.NOTEQUALS) if (code == AssertionOperatorType.NOTEQUALS)
@ -828,6 +834,8 @@ public class TestScript extends DomainResource {
} }
public String toCode(AssertionResponseTypes code) { public String toCode(AssertionResponseTypes code) {
if (code == null)
return null;
if (code == AssertionResponseTypes.OKAY) if (code == AssertionResponseTypes.OKAY)
return "okay"; return "okay";
if (code == AssertionResponseTypes.CREATED) if (code == AssertionResponseTypes.CREATED)

View File

@ -246,6 +246,8 @@ public class Timing extends Type implements ICompositeType {
} }
public String toCode(UnitsOfTime code) { public String toCode(UnitsOfTime code) {
if (code == null)
return null;
if (code == UnitsOfTime.S) if (code == UnitsOfTime.S)
return "s"; return "s";
if (code == UnitsOfTime.MIN) if (code == UnitsOfTime.MIN)
@ -583,6 +585,8 @@ public class Timing extends Type implements ICompositeType {
} }
public String toCode(EventTiming code) { public String toCode(EventTiming code) {
if (code == null)
return null;
if (code == EventTiming.HS) if (code == EventTiming.HS)
return "HS"; return "HS";
if (code == EventTiming.WAKE) if (code == EventTiming.WAKE)

View File

@ -231,6 +231,8 @@ public class ValueSet extends DomainResource {
} }
public String toCode(FilterOperator code) { public String toCode(FilterOperator code) {
if (code == null)
return null;
if (code == FilterOperator.EQUAL) if (code == FilterOperator.EQUAL)
return "="; return "=";
if (code == FilterOperator.ISA) if (code == FilterOperator.ISA)

View File

@ -155,6 +155,8 @@ public class VisionPrescription extends DomainResource {
} }
public String toCode(VisionEyes code) { public String toCode(VisionEyes code) {
if (code == null)
return null;
if (code == VisionEyes.RIGHT) if (code == VisionEyes.RIGHT)
return "right"; return "right";
if (code == VisionEyes.LEFT) if (code == VisionEyes.LEFT)
@ -302,6 +304,8 @@ public class VisionPrescription extends DomainResource {
} }
public String toCode(VisionBase code) { public String toCode(VisionBase code) {
if (code == null)
return null;
if (code == VisionBase.UP) if (code == VisionBase.UP)
return "up"; return "up";
if (code == VisionBase.DOWN) if (code == VisionBase.DOWN)