From cee02ea6050ecc96cebd05fd38ed136c15280145 Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Tue, 9 Dec 2014 08:24:35 -0500 Subject: [PATCH] More structures work from hl7 --- .../org/hl7/fhir/instance/model/Address.java | 22 +- .../java/org/hl7/fhir/instance/model/Age.java | 2 +- .../org/hl7/fhir/instance/model/Alert.java | 22 +- .../instance/model/AllergyIntolerance.java | 164 +- .../hl7/fhir/instance/model/Appointment.java | 54 +- .../instance/model/AppointmentResponse.java | 34 +- .../hl7/fhir/instance/model/Attachment.java | 2 +- .../hl7/fhir/instance/model/Availability.java | 6 +- .../fhir/instance/model/BackboneElement.java | 2 +- .../fhir/instance/model/Base64BinaryType.java | 7 + .../fhir/instance/model/BaseDateTimeType.java | 256 +- .../org/hl7/fhir/instance/model/Basic.java | 6 +- .../org/hl7/fhir/instance/model/Binary.java | 4 +- .../hl7/fhir/instance/model/BooleanType.java | 9 +- .../org/hl7/fhir/instance/model/Bundle.java | 102 +- .../hl7/fhir/instance/model/CareActivity.java | 1322 ++++++ .../org/hl7/fhir/instance/model/CarePlan.java | 86 +- .../hl7/fhir/instance/model/CarePlan2.java | 856 ++++ .../fhir/instance/model/ClaimResponse.java | 86 +- .../instance/model/ClinicalAssessment.java | 1400 ++++++ .../org/hl7/fhir/instance/model/CodeType.java | 4 +- .../fhir/instance/model/CodeableConcept.java | 2 +- .../org/hl7/fhir/instance/model/Coding.java | 2 +- .../fhir/instance/model/Communication.java | 917 ++++ .../instance/model/CommunicationRequest.java | 54 +- .../hl7/fhir/instance/model/Composition.java | 52 +- .../hl7/fhir/instance/model/ConceptMap.java | 80 +- .../hl7/fhir/instance/model/Condition.java | 26 +- .../fhir/instance/model/Configuration.java | 6 +- .../hl7/fhir/instance/model/Conformance.java | 190 +- .../hl7/fhir/instance/model/Constants.java | 6 +- .../hl7/fhir/instance/model/ContactPoint.java | 42 +- .../org/hl7/fhir/instance/model/Contract.java | 984 ++++- .../fhir/instance/model/Contraindication.java | 10 +- .../org/hl7/fhir/instance/model/Count.java | 2 +- .../org/hl7/fhir/instance/model/Coverage.java | 2 +- .../hl7/fhir/instance/model/DataElement.java | 129 +- .../hl7/fhir/instance/model/DateAndTime.java | 12 +- .../hl7/fhir/instance/model/DateTimeType.java | 46 +- .../org/hl7/fhir/instance/model/DateType.java | 2 + .../hl7/fhir/instance/model/DecimalType.java | 4 +- .../org/hl7/fhir/instance/model/Device.java | 6 +- .../fhir/instance/model/DeviceComponent.java | 26 +- .../hl7/fhir/instance/model/DeviceMetric.java | 1185 +++++ .../fhir/instance/model/DeviceUseRequest.java | 70 +- .../instance/model/DeviceUseStatement.java | 6 +- .../fhir/instance/model/DiagnosticOrder.java | 50 +- .../fhir/instance/model/DiagnosticReport.java | 30 +- .../org/hl7/fhir/instance/model/Distance.java | 2 +- .../fhir/instance/model/DocumentManifest.java | 26 +- .../instance/model/DocumentReference.java | 50 +- .../fhir/instance/model/DomainResource.java | 2 +- .../org/hl7/fhir/instance/model/Duration.java | 2 +- .../org/hl7/fhir/instance/model/Element.java | 2 +- .../instance/model/ElementDefinition.java | 98 +- ...igibility.java => EligibilityRequest.java} | 102 +- .../instance/model/EligibilityResponse.java | 89 +- .../hl7/fhir/instance/model/Encounter.java | 42 +- ...Enrollment.java => EnrollmentRequest.java} | 128 +- .../instance/model/EnrollmentResponse.java | 89 +- .../hl7/fhir/instance/model/EnumFactory.java | 6 +- .../hl7/fhir/instance/model/Enumeration.java | 119 +- .../instance/model/ExplanationOfBenefit.java | 77 +- .../hl7/fhir/instance/model/Extension.java | 2 +- .../instance/model/ExtensionDefinition.java | 46 +- .../org/hl7/fhir/instance/model/Factory.java | 175 - .../fhir/instance/model/FamilyHistory.java | 6 +- .../org/hl7/fhir/instance/model/FhirEnum.java | 47 + .../org/hl7/fhir/instance/model/Goal.java | 532 +++ .../hl7/fhir/instance/model/GoalRequest.java | 681 +++ .../org/hl7/fhir/instance/model/Group.java | 22 +- .../instance/model/HealthcareService.java | 18 +- .../hl7/fhir/instance/model/HumanName.java | 22 +- .../org/hl7/fhir/instance/model/IdType.java | 69 +- .../hl7/fhir/instance/model/Identifier.java | 22 +- .../model/ImagingObjectSelection.java | 6 +- .../hl7/fhir/instance/model/ImagingStudy.java | 70 +- .../hl7/fhir/instance/model/Immunization.java | 18 +- .../model/ImmunizationRecommendation.java | 10 +- .../hl7/fhir/instance/model/InstantType.java | 23 +- .../instance/model/InstitutionalClaim.java | 3786 ++++++++++++++++ .../hl7/fhir/instance/model/IntegerType.java | 117 +- .../org/hl7/fhir/instance/model/List_.java | 30 +- .../org/hl7/fhir/instance/model/Location.java | 42 +- .../org/hl7/fhir/instance/model/Media.java | 26 +- .../hl7/fhir/instance/model/Medication.java | 22 +- .../model/MedicationAdministration.java | 22 +- .../instance/model/MedicationDispense.java | 32 +- .../model/MedicationPrescription.java | 26 +- .../instance/model/MedicationStatement.java | 2 +- .../fhir/instance/model/MessageHeader.java | 26 +- .../org/hl7/fhir/instance/model/Money.java | 2 +- .../hl7/fhir/instance/model/NamingSystem.java | 63 +- .../hl7/fhir/instance/model/Narrative.java | 22 +- .../fhir/instance/model/NutritionOrder.java | 745 ++-- .../hl7/fhir/instance/model/Observation.java | 86 +- .../org/hl7/fhir/instance/model/OidType.java | 53 +- .../instance/model/OperationDefinition.java | 534 ++- .../fhir/instance/model/OperationOutcome.java | 22 +- .../fhir/instance/model/OralHealthClaim.java | 192 +- .../org/hl7/fhir/instance/model/Order.java | 6 +- .../fhir/instance/model/OrderResponse.java | 26 +- .../hl7/fhir/instance/model/Organization.java | 22 +- .../org/hl7/fhir/instance/model/Other.java | 6 +- .../hl7/fhir/instance/model/Parameters.java | 162 +- .../org/hl7/fhir/instance/model/Patient.java | 52 +- .../fhir/instance/model/PaymentNotice.java | 56 +- .../instance/model/PaymentReconciliation.java | 145 +- .../fhir/instance/model/PendedRequest.java | 93 +- .../org/hl7/fhir/instance/model/Period.java | 10 +- .../org/hl7/fhir/instance/model/Person.java | 927 ++++ .../fhir/instance/model/PharmacyClaim.java | 3903 +++++++++++++++++ .../hl7/fhir/instance/model/Practitioner.java | 26 +- .../fhir/instance/model/PrimitiveType.java | 21 +- .../hl7/fhir/instance/model/Procedure.java | 22 +- .../fhir/instance/model/ProcedureRequest.java | 66 +- .../instance/model/ProfessionalClaim.java | 3786 ++++++++++++++++ .../org/hl7/fhir/instance/model/Profile.java | 26 +- .../hl7/fhir/instance/model/Provenance.java | 26 +- .../org/hl7/fhir/instance/model/Quantity.java | 22 +- .../org/hl7/fhir/instance/model/Query.java | 790 ---- .../fhir/instance/model/Questionnaire.java | 70 +- .../instance/model/QuestionnaireAnswers.java | 26 +- .../org/hl7/fhir/instance/model/Range.java | 2 +- .../org/hl7/fhir/instance/model/Ratio.java | 2 +- .../hl7/fhir/instance/model/Readjudicate.java | 54 +- .../hl7/fhir/instance/model/Reference.java | 2 +- .../fhir/instance/model/ReferralRequest.java | 26 +- .../fhir/instance/model/RelatedPerson.java | 22 +- .../org/hl7/fhir/instance/model/Resource.java | 8 +- .../fhir/instance/model/ResourceFactory.java | 269 -- .../instance/model/ResourceReference.java | 146 + .../hl7/fhir/instance/model/ResourceType.java | 305 +- .../org/hl7/fhir/instance/model/Reversal.java | 54 +- .../fhir/instance/model/RiskAssessment.java | 6 +- .../hl7/fhir/instance/model/SampledData.java | 2 +- .../org/hl7/fhir/instance/model/Schedule.java | 573 --- .../fhir/instance/model/SearchParameter.java | 23 +- .../fhir/instance/model/SecurityEvent.java | 126 +- .../org/hl7/fhir/instance/model/SidType.java | 37 +- .../org/hl7/fhir/instance/model/Slot.java | 34 +- .../org/hl7/fhir/instance/model/Specimen.java | 26 +- .../fhir/instance/model/StatusRequest.java | 54 +- .../fhir/instance/model/StatusResponse.java | 59 +- .../hl7/fhir/instance/model/StringType.java | 92 +- .../hl7/fhir/instance/model/Subscription.java | 46 +- .../hl7/fhir/instance/model/Substance.java | 6 +- .../org/hl7/fhir/instance/model/Supply.java | 42 +- .../model/SupportingDocumentation.java | 58 +- .../instance/model/TemporalPrecisionEnum.java | 7 +- .../org/hl7/fhir/instance/model/Timing.java | 46 +- .../org/hl7/fhir/instance/model/Type.java | 7 +- .../org/hl7/fhir/instance/model/UriType.java | 53 +- .../org/hl7/fhir/instance/model/UuidType.java | 35 +- .../org/hl7/fhir/instance/model/ValueSet.java | 54 +- .../hl7/fhir/instance/model/VisionClaim.java | 3786 ++++++++++++++++ 156 files changed, 28600 insertions(+), 4591 deletions(-) create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CareActivity.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan2.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClinicalAssessment.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Communication.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java rename hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/{Eligibility.java => EligibilityRequest.java} (79%) rename hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/{Enrollment.java => EnrollmentRequest.java} (80%) delete mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Factory.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Goal.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/GoalRequest.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstitutionalClaim.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Person.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PharmacyClaim.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProfessionalClaim.java delete mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Query.java delete mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceFactory.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceReference.java delete mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Schedule.java create mode 100644 hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/VisionClaim.java diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Address.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Address.java index 7bfb499f930..0bc05c53a95 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Address.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Address.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef; @DatatypeDef(name="Address") public class Address extends Type { - public enum AddressUse { + public enum AddressUse implements FhirEnum { /** * A communication address at a home. */ @@ -64,7 +64,10 @@ public class Address extends Type { * added to help the parsers */ NULL; - public static AddressUse fromCode(String codeString) throws Exception { + + public static final AddressUseEnumFactory ENUM_FACTORY = new AddressUseEnumFactory(); + + public static AddressUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("home".equals(codeString)) @@ -75,8 +78,9 @@ public class Address extends Type { return TEMP; if ("old".equals(codeString)) return OLD; - throw new Exception("Unknown AddressUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case HOME: return "home"; @@ -115,8 +119,8 @@ public class Address extends Type { } } - public static class AddressUseEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AddressUseEnumFactory implements EnumFactory { + public AddressUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -128,9 +132,9 @@ public class Address extends Type { return AddressUse.TEMP; if ("old".equals(codeString)) return AddressUse.OLD; - throw new Exception("Unknown AddressUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AddressUse code) throws IllegalArgumentException { if (code == AddressUse.HOME) return "home"; if (code == AddressUse.WORK) @@ -249,7 +253,7 @@ P.O. Box number, delivery hints, and similar address information. this.use = null; else { if (this.use == null) - this.use = new Enumeration(); + this.use = new Enumeration(AddressUse.ENUM_FACTORY); this.use.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Age.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Age.java index 8a9ada1f381..458e48d2f52 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Age.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Age.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import org.hl7.fhir.instance.model.annotations.DatatypeDef; /** diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Alert.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Alert.java index 28a88c67f36..c6769444c1b 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Alert.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Alert.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Alert", profile="http://hl7.org/fhir/Profile/Alert") public class Alert extends DomainResource { - public enum AlertStatus { + public enum AlertStatus implements FhirEnum { /** * A current alert that should be displayed to a user. A system may use the category to determine which roles should view the alert. */ @@ -62,7 +62,10 @@ public class Alert extends DomainResource { * added to help the parsers */ NULL; - public static AlertStatus fromCode(String codeString) throws Exception { + + public static final AlertStatusEnumFactory ENUM_FACTORY = new AlertStatusEnumFactory(); + + public static AlertStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("active".equals(codeString)) @@ -71,8 +74,9 @@ public class Alert extends DomainResource { return INACTIVE; if ("entered in error".equals(codeString)) return ENTEREDINERROR; - throw new Exception("Unknown AlertStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ACTIVE: return "active"; @@ -107,8 +111,8 @@ public class Alert extends DomainResource { } } - public static class AlertStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AlertStatusEnumFactory implements EnumFactory { + public AlertStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class Alert extends DomainResource { return AlertStatus.INACTIVE; if ("entered in error".equals(codeString)) return AlertStatus.ENTEREDINERROR; - throw new Exception("Unknown AlertStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AlertStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AlertStatus code) throws IllegalArgumentException { if (code == AlertStatus.ACTIVE) return "active"; if (code == AlertStatus.INACTIVE) @@ -290,7 +294,7 @@ public class Alert extends DomainResource { */ public Alert setStatus(AlertStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(AlertStatus.ENUM_FACTORY); this.status.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java index e5e6c6eefac..fe01113a5c3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AllergyIntolerance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/Profile/AllergyIntolerance") public class AllergyIntolerance extends DomainResource { - public enum AllergyIntoleranceStatus { + public enum AllergyIntoleranceStatus implements FhirEnum { /** * A low level of certainty about the propensity for a reaction to the identified Substance. */ @@ -66,7 +66,10 @@ public class AllergyIntolerance extends DomainResource { * added to help the parsers */ NULL; - public static AllergyIntoleranceStatus fromCode(String codeString) throws Exception { + + public static final AllergyIntoleranceStatusEnumFactory ENUM_FACTORY = new AllergyIntoleranceStatusEnumFactory(); + + public static AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("unconfirmed".equals(codeString)) @@ -77,8 +80,9 @@ public class AllergyIntolerance extends DomainResource { return RESOLVED; if ("refuted".equals(codeString)) return REFUTED; - throw new Exception("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case UNCONFIRMED: return "unconfirmed"; @@ -117,8 +121,8 @@ public class AllergyIntolerance extends DomainResource { } } - public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory { + public AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class AllergyIntolerance extends DomainResource { return AllergyIntoleranceStatus.RESOLVED; if ("refuted".equals(codeString)) return AllergyIntoleranceStatus.REFUTED; - throw new Exception("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AllergyIntoleranceStatus code) throws IllegalArgumentException { if (code == AllergyIntoleranceStatus.UNCONFIRMED) return "unconfirmed"; if (code == AllergyIntoleranceStatus.CONFIRMED) @@ -145,32 +149,43 @@ public class AllergyIntolerance extends DomainResource { } } - public enum AllergyIntoleranceCriticality { + public enum AllergyIntoleranceCriticality implements FhirEnum { /** - * The potential clinical impact of a future reaction is estimated as low risk. Future exposure to the Substance is considered a relative contra-indication. + * The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication. */ LOW, /** - * The potential clinical impact of a future reaction is estimated as high risk. Future exposure to the Substance may be considered an absolute contra-indication. + * The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication. */ HIGH, + /** + * Unable to assess the potential clinical impact with the information available. + */ + UNASSESSIBLE, /** * added to help the parsers */ NULL; - public static AllergyIntoleranceCriticality fromCode(String codeString) throws Exception { + + public static final AllergyIntoleranceCriticalityEnumFactory ENUM_FACTORY = new AllergyIntoleranceCriticalityEnumFactory(); + + public static AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("low".equals(codeString)) return LOW; if ("high".equals(codeString)) return HIGH; - throw new Exception("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); + if ("unassessible".equals(codeString)) + return UNASSESSIBLE; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case LOW: return "low"; case HIGH: return "high"; + case UNASSESSIBLE: return "unassessible"; default: return "?"; } } @@ -178,13 +193,15 @@ public class AllergyIntolerance extends DomainResource { switch (this) { case LOW: return ""; case HIGH: return ""; + case UNASSESSIBLE: return ""; default: return "?"; } } public String getDefinition() { switch (this) { - case LOW: return "The potential clinical impact of a future reaction is estimated as low risk. Future exposure to the Substance is considered a relative contra-indication."; - case HIGH: return "The potential clinical impact of a future reaction is estimated as high risk. Future exposure to the Substance may be considered an absolute contra-indication."; + case LOW: return "The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication."; + case HIGH: return "The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication."; + case UNASSESSIBLE: return "Unable to assess the potential clinical impact with the information available."; default: return "?"; } } @@ -192,13 +209,14 @@ public class AllergyIntolerance extends DomainResource { switch (this) { case LOW: return "Low Risk"; case HIGH: return "High Risk"; + case UNASSESSIBLE: return "Unable to determine"; default: return "?"; } } } - public static class AllergyIntoleranceCriticalityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AllergyIntoleranceCriticalityEnumFactory implements EnumFactory { + public AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -206,18 +224,22 @@ public class AllergyIntolerance extends DomainResource { return AllergyIntoleranceCriticality.LOW; if ("high".equals(codeString)) return AllergyIntoleranceCriticality.HIGH; - throw new Exception("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); + if ("unassessible".equals(codeString)) + return AllergyIntoleranceCriticality.UNASSESSIBLE; + throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AllergyIntoleranceCriticality code) throws IllegalArgumentException { if (code == AllergyIntoleranceCriticality.LOW) return "low"; if (code == AllergyIntoleranceCriticality.HIGH) return "high"; + if (code == AllergyIntoleranceCriticality.UNASSESSIBLE) + return "unassessible"; return "?"; } } - public enum AllergyIntoleranceType { + public enum AllergyIntoleranceType implements FhirEnum { /** * Immune mediated reaction, including allergic reactions and hypersensitivities. */ @@ -230,15 +252,19 @@ public class AllergyIntolerance extends DomainResource { * added to help the parsers */ NULL; - public static AllergyIntoleranceType fromCode(String codeString) throws Exception { + + public static final AllergyIntoleranceTypeEnumFactory ENUM_FACTORY = new AllergyIntoleranceTypeEnumFactory(); + + public static AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("immune".equals(codeString)) return IMMUNE; if ("non-immune".equals(codeString)) return NONIMMUNE; - throw new Exception("Unknown AllergyIntoleranceType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case IMMUNE: return "immune"; @@ -269,8 +295,8 @@ public class AllergyIntolerance extends DomainResource { } } - public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory { + public AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -278,9 +304,9 @@ public class AllergyIntolerance extends DomainResource { return AllergyIntoleranceType.IMMUNE; if ("non-immune".equals(codeString)) return AllergyIntoleranceType.NONIMMUNE; - throw new Exception("Unknown AllergyIntoleranceType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AllergyIntoleranceType code) throws IllegalArgumentException { if (code == AllergyIntoleranceType.IMMUNE) return "immune"; if (code == AllergyIntoleranceType.NONIMMUNE) @@ -289,7 +315,7 @@ public class AllergyIntolerance extends DomainResource { } } - public enum AllergyIntoleranceCategory { + public enum AllergyIntoleranceCategory implements FhirEnum { /** * Any substance consumed to provide nutritional support for the body. */ @@ -306,7 +332,10 @@ public class AllergyIntolerance extends DomainResource { * added to help the parsers */ NULL; - public static AllergyIntoleranceCategory fromCode(String codeString) throws Exception { + + public static final AllergyIntoleranceCategoryEnumFactory ENUM_FACTORY = new AllergyIntoleranceCategoryEnumFactory(); + + public static AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("food".equals(codeString)) @@ -315,8 +344,9 @@ public class AllergyIntolerance extends DomainResource { return MEDICATION; if ("environment".equals(codeString)) return ENVIRONMENT; - throw new Exception("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case FOOD: return "food"; @@ -351,8 +381,8 @@ public class AllergyIntolerance extends DomainResource { } } - public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory { + public AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -362,9 +392,9 @@ public class AllergyIntolerance extends DomainResource { return AllergyIntoleranceCategory.MEDICATION; if ("environment".equals(codeString)) return AllergyIntoleranceCategory.ENVIRONMENT; - throw new Exception("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AllergyIntoleranceCategory code) throws IllegalArgumentException { if (code == AllergyIntoleranceCategory.FOOD) return "food"; if (code == AllergyIntoleranceCategory.MEDICATION) @@ -375,7 +405,7 @@ public class AllergyIntolerance extends DomainResource { } } - public enum ReactionEventCertainty { + public enum ReactionEventCertainty implements FhirEnum { /** * There is a low level of clinical certainty that the reaction was caused by the identified Substance. */ @@ -392,7 +422,10 @@ public class AllergyIntolerance extends DomainResource { * added to help the parsers */ NULL; - public static ReactionEventCertainty fromCode(String codeString) throws Exception { + + public static final ReactionEventCertaintyEnumFactory ENUM_FACTORY = new ReactionEventCertaintyEnumFactory(); + + public static ReactionEventCertainty fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("unlikely".equals(codeString)) @@ -401,8 +434,9 @@ public class AllergyIntolerance extends DomainResource { return LIKELY; if ("confirmed".equals(codeString)) return CONFIRMED; - throw new Exception("Unknown ReactionEventCertainty code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case UNLIKELY: return "unlikely"; @@ -437,8 +471,8 @@ public class AllergyIntolerance extends DomainResource { } } - public static class ReactionEventCertaintyEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ReactionEventCertaintyEnumFactory implements EnumFactory { + public ReactionEventCertainty fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -448,9 +482,9 @@ public class AllergyIntolerance extends DomainResource { return ReactionEventCertainty.LIKELY; if ("confirmed".equals(codeString)) return ReactionEventCertainty.CONFIRMED; - throw new Exception("Unknown ReactionEventCertainty code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ReactionEventCertainty code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ReactionEventCertainty code) throws IllegalArgumentException { if (code == ReactionEventCertainty.UNLIKELY) return "unlikely"; if (code == ReactionEventCertainty.LIKELY) @@ -461,7 +495,7 @@ public class AllergyIntolerance extends DomainResource { } } - public enum ReactionEventSeverity { + public enum ReactionEventSeverity implements FhirEnum { /** * Causes mild physiological effects. */ @@ -478,7 +512,10 @@ public class AllergyIntolerance extends DomainResource { * added to help the parsers */ NULL; - public static ReactionEventSeverity fromCode(String codeString) throws Exception { + + public static final ReactionEventSeverityEnumFactory ENUM_FACTORY = new ReactionEventSeverityEnumFactory(); + + public static ReactionEventSeverity fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("mild".equals(codeString)) @@ -487,8 +524,9 @@ public class AllergyIntolerance extends DomainResource { return MODERATE; if ("severe".equals(codeString)) return SEVERE; - throw new Exception("Unknown ReactionEventSeverity code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case MILD: return "mild"; @@ -523,8 +561,8 @@ public class AllergyIntolerance extends DomainResource { } } - public static class ReactionEventSeverityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ReactionEventSeverityEnumFactory implements EnumFactory { + public ReactionEventSeverity fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -534,9 +572,9 @@ public class AllergyIntolerance extends DomainResource { return ReactionEventSeverity.MODERATE; if ("severe".equals(codeString)) return ReactionEventSeverity.SEVERE; - throw new Exception("Unknown ReactionEventSeverity code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ReactionEventSeverity code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ReactionEventSeverity code) throws IllegalArgumentException { if (code == ReactionEventSeverity.MILD) return "mild"; if (code == ReactionEventSeverity.MODERATE) @@ -685,7 +723,7 @@ public class AllergyIntolerance extends DomainResource { this.certainty = null; else { if (this.certainty == null) - this.certainty = new Enumeration(); + this.certainty = new Enumeration(ReactionEventCertainty.ENUM_FACTORY); this.certainty.setValue(value); } return this; @@ -801,14 +839,14 @@ public class AllergyIntolerance extends DomainResource { /** * @return Record of the date and/or time of the onset of the Reaction. */ - public DateAndTime getOnset() { + public Date getOnset() { return this.onset == null ? null : this.onset.getValue(); } /** * @param value Record of the date and/or time of the onset of the Reaction. */ - public AllergyIntoleranceEventComponent setOnset(DateAndTime value) { + public AllergyIntoleranceEventComponent setOnset(Date value) { if (value == null) this.onset = null; else { @@ -886,7 +924,7 @@ public class AllergyIntolerance extends DomainResource { this.severity = null; else { if (this.severity == null) - this.severity = new Enumeration(); + this.severity = new Enumeration(ReactionEventSeverity.ENUM_FACTORY); this.severity.setValue(value); } return this; @@ -1063,7 +1101,7 @@ public class AllergyIntolerance extends DomainResource { * Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. */ @Child(name="criticality", type={CodeType.class}, order=5, min=0, max=1) - @Description(shortDefinition="low | high - Estimated potential clinical harm", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." ) + @Description(shortDefinition="low | high | unassessible - Estimated potential clinical harm", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." ) protected Enumeration criticality; /** @@ -1174,14 +1212,14 @@ public class AllergyIntolerance extends DomainResource { /** * @return Date when the sensitivity was recorded. */ - public DateAndTime getRecordedDate() { + public Date getRecordedDate() { return this.recordedDate == null ? null : this.recordedDate.getValue(); } /** * @param value Date when the sensitivity was recorded. */ - public AllergyIntolerance setRecordedDate(DateAndTime value) { + public AllergyIntolerance setRecordedDate(Date value) { if (value == null) this.recordedDate = null; else { @@ -1342,7 +1380,7 @@ public class AllergyIntolerance extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(AllergyIntoleranceStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -1391,7 +1429,7 @@ public class AllergyIntolerance extends DomainResource { this.criticality = null; else { if (this.criticality == null) - this.criticality = new Enumeration(); + this.criticality = new Enumeration(AllergyIntoleranceCriticality.ENUM_FACTORY); this.criticality.setValue(value); } return this; @@ -1440,7 +1478,7 @@ public class AllergyIntolerance extends DomainResource { this.type = null; else { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(AllergyIntoleranceType.ENUM_FACTORY); this.type.setValue(value); } return this; @@ -1489,7 +1527,7 @@ public class AllergyIntolerance extends DomainResource { this.category = null; else { if (this.category == null) - this.category = new Enumeration(); + this.category = new Enumeration(AllergyIntoleranceCategory.ENUM_FACTORY); this.category.setValue(value); } return this; @@ -1526,14 +1564,14 @@ public class AllergyIntolerance extends DomainResource { /** * @return Represents the date and/or time of the last known occurence of a reaction event. */ - public DateAndTime getLastOccurence() { + public Date getLastOccurence() { return this.lastOccurence == null ? null : this.lastOccurence.getValue(); } /** * @param value Represents the date and/or time of the last known occurence of a reaction event. */ - public AllergyIntolerance setLastOccurence(DateAndTime value) { + public AllergyIntolerance setLastOccurence(Date value) { if (value == null) this.lastOccurence = null; else { @@ -1692,13 +1730,13 @@ public class AllergyIntolerance extends DomainResource { public static final String SP_LASTDATE = "last-date"; @SearchParamDefinition(name="severity", path="AllergyIntolerance.event.severity", description="mild | moderate | severe (of event as a whole)", type="token" ) public static final String SP_SEVERITY = "severity"; - @SearchParamDefinition(name="type", path="AllergyIntolerance.type", description="immune | non-immune - Underlying mechanism (if known)", type="token" ) - public static final String SP_TYPE = "type"; @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate", description="When recorded", type="date" ) public static final String SP_DATE = "date"; + @SearchParamDefinition(name="type", path="AllergyIntolerance.type", description="immune | non-immune - Underlying mechanism (if known)", type="token" ) + public static final String SP_TYPE = "type"; @SearchParamDefinition(name="substance", path="AllergyIntolerance.substance|AllergyIntolerance.event.substance", description="Substance, (or class) considered to be responsible for risk", type="token" ) public static final String SP_SUBSTANCE = "substance"; - @SearchParamDefinition(name="criticality", path="AllergyIntolerance.criticality", description="low | high - Estimated potential clinical harm", type="token" ) + @SearchParamDefinition(name="criticality", path="AllergyIntolerance.criticality", description="low | high | unassessible - Estimated potential clinical harm", type="token" ) public static final String SP_CRITICALITY = "criticality"; @SearchParamDefinition(name="category", path="AllergyIntolerance.category", description="food | medication | environment - Category of Substance", type="token" ) public static final String SP_CATEGORY = "category"; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Appointment.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Appointment.java index b364ce86b07..7f9d2edc59d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Appointment.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Appointment.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Appointment", profile="http://hl7.org/fhir/Profile/Appointment") public class Appointment extends DomainResource { - public enum Participantrequired { + public enum Participantrequired implements FhirEnum { /** * The participant is required to attend the appointment. */ @@ -62,7 +62,10 @@ public class Appointment extends DomainResource { * added to help the parsers */ NULL; - public static Participantrequired fromCode(String codeString) throws Exception { + + public static final ParticipantrequiredEnumFactory ENUM_FACTORY = new ParticipantrequiredEnumFactory(); + + public static Participantrequired fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("required".equals(codeString)) @@ -71,8 +74,9 @@ public class Appointment extends DomainResource { return OPTIONAL; if ("information-only".equals(codeString)) return INFORMATIONONLY; - throw new Exception("Unknown Participantrequired code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUIRED: return "required"; @@ -107,8 +111,8 @@ public class Appointment extends DomainResource { } } - public static class ParticipantrequiredEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ParticipantrequiredEnumFactory implements EnumFactory { + public Participantrequired fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class Appointment extends DomainResource { return Participantrequired.OPTIONAL; if ("information-only".equals(codeString)) return Participantrequired.INFORMATIONONLY; - throw new Exception("Unknown Participantrequired code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Participantrequired code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(Participantrequired code) throws IllegalArgumentException { if (code == Participantrequired.REQUIRED) return "required"; if (code == Participantrequired.OPTIONAL) @@ -131,7 +135,7 @@ public class Appointment extends DomainResource { } } - public enum Participationstatus { + public enum Participationstatus implements FhirEnum { /** * The participant has accepted the appointment. */ @@ -160,7 +164,10 @@ public class Appointment extends DomainResource { * added to help the parsers */ NULL; - public static Participationstatus fromCode(String codeString) throws Exception { + + public static final ParticipationstatusEnumFactory ENUM_FACTORY = new ParticipationstatusEnumFactory(); + + public static Participationstatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("accepted".equals(codeString)) @@ -175,8 +182,9 @@ public class Appointment extends DomainResource { return COMPLETED; if ("needs-action".equals(codeString)) return NEEDSACTION; - throw new Exception("Unknown Participationstatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ACCEPTED: return "accepted"; @@ -223,8 +231,8 @@ public class Appointment extends DomainResource { } } - public static class ParticipationstatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ParticipationstatusEnumFactory implements EnumFactory { + public Participationstatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -240,9 +248,9 @@ public class Appointment extends DomainResource { return Participationstatus.COMPLETED; if ("needs-action".equals(codeString)) return Participationstatus.NEEDSACTION; - throw new Exception("Unknown Participationstatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Participationstatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(Participationstatus code) throws IllegalArgumentException { if (code == Participationstatus.ACCEPTED) return "accepted"; if (code == Participationstatus.DECLINED) @@ -417,7 +425,7 @@ public class Appointment extends DomainResource { this.required = null; else { if (this.required == null) - this.required = new Enumeration(); + this.required = new Enumeration(Participantrequired.ENUM_FACTORY); this.required.setValue(value); } return this; @@ -463,7 +471,7 @@ public class Appointment extends DomainResource { */ public AppointmentParticipantComponent setStatus(Participationstatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(Participationstatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -890,14 +898,14 @@ public class Appointment extends DomainResource { /** * @return Date/Time that the appointment is to take place. */ - public DateAndTime getStart() { + public Date getStart() { return this.start == null ? null : this.start.getValue(); } /** * @param value Date/Time that the appointment is to take place. */ - public Appointment setStart(DateAndTime value) { + public Appointment setStart(Date value) { if (this.start == null) this.start = new InstantType(); this.start.setValue(value); @@ -935,14 +943,14 @@ public class Appointment extends DomainResource { /** * @return Date/Time that the appointment is to conclude. */ - public DateAndTime getEnd() { + public Date getEnd() { return this.end == null ? null : this.end.getValue(); } /** * @param value Date/Time that the appointment is to conclude. */ - public Appointment setEnd(DateAndTime value) { + public Appointment setEnd(Date value) { if (this.end == null) this.end = new InstantType(); this.end.setValue(value); @@ -1237,14 +1245,14 @@ public class Appointment extends DomainResource { /** * @return Date when the appointment was recorded. */ - public DateAndTime getLastModified() { + public Date getLastModified() { return this.lastModified == null ? null : this.lastModified.getValue(); } /** * @param value Date when the appointment was recorded. */ - public Appointment setLastModified(DateAndTime value) { + public Appointment setLastModified(Date value) { if (value == null) this.lastModified = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java index 32711fe9682..5ac966d8c8c 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/AppointmentResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/Profile/AppointmentResponse") public class AppointmentResponse extends DomainResource { - public enum Participantstatus { + public enum Participantstatus implements FhirEnum { /** * The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse. */ @@ -74,7 +74,10 @@ public class AppointmentResponse extends DomainResource { * added to help the parsers */ NULL; - public static Participantstatus fromCode(String codeString) throws Exception { + + public static final ParticipantstatusEnumFactory ENUM_FACTORY = new ParticipantstatusEnumFactory(); + + public static Participantstatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("accepted".equals(codeString)) @@ -89,8 +92,9 @@ public class AppointmentResponse extends DomainResource { return COMPLETED; if ("needs-action".equals(codeString)) return NEEDSACTION; - throw new Exception("Unknown Participantstatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ACCEPTED: return "accepted"; @@ -137,8 +141,8 @@ public class AppointmentResponse extends DomainResource { } } - public static class ParticipantstatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ParticipantstatusEnumFactory implements EnumFactory { + public Participantstatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -154,9 +158,9 @@ public class AppointmentResponse extends DomainResource { return Participantstatus.COMPLETED; if ("needs-action".equals(codeString)) return Participantstatus.NEEDSACTION; - throw new Exception("Unknown Participantstatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Participantstatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(Participantstatus code) throws IllegalArgumentException { if (code == Participantstatus.ACCEPTED) return "accepted"; if (code == Participantstatus.DECLINED) @@ -453,7 +457,7 @@ public class AppointmentResponse extends DomainResource { */ public AppointmentResponse setParticipantStatus(Participantstatus value) { if (this.participantStatus == null) - this.participantStatus = new Enumeration(); + this.participantStatus = new Enumeration(Participantstatus.ENUM_FACTORY); this.participantStatus.setValue(value); return this; } @@ -538,14 +542,14 @@ public class AppointmentResponse extends DomainResource { /** * @return Date/Time that the appointment is to take place. */ - public DateAndTime getStart() { + public Date getStart() { return this.start == null ? null : this.start.getValue(); } /** * @param value Date/Time that the appointment is to take place. */ - public AppointmentResponse setStart(DateAndTime value) { + public AppointmentResponse setStart(Date value) { if (value == null) this.start = null; else { @@ -587,14 +591,14 @@ public class AppointmentResponse extends DomainResource { /** * @return Date/Time that the appointment is to conclude. */ - public DateAndTime getEnd() { + public Date getEnd() { return this.end == null ? null : this.end.getValue(); } /** * @param value Date/Time that the appointment is to conclude. */ - public AppointmentResponse setEnd(DateAndTime value) { + public AppointmentResponse setEnd(Date value) { if (value == null) this.end = null; else { @@ -675,14 +679,14 @@ public class AppointmentResponse extends DomainResource { /** * @return Date when the response was recorded or last updated. */ - public DateAndTime getLastModified() { + public Date getLastModified() { return this.lastModified == null ? null : this.lastModified.getValue(); } /** * @param value Date when the response was recorded or last updated. */ - public AppointmentResponse setLastModified(DateAndTime value) { + public AppointmentResponse setLastModified(Date value) { if (value == null) this.lastModified = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Attachment.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Attachment.java index b7ef55222a4..f08027b3185 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Attachment.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Attachment.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Availability.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Availability.java index be3459d1c42..6500b880a67 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Availability.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Availability.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -306,14 +306,14 @@ public class Availability extends DomainResource { /** * @return When this availability was created, or last revised. */ - public DateAndTime getLastModified() { + public Date getLastModified() { return this.lastModified == null ? null : this.lastModified.getValue(); } /** * @param value When this availability was created, or last revised. */ - public Availability setLastModified(DateAndTime value) { + public Availability setLastModified(Date value) { if (value == null) this.lastModified = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java index f1292e87eac..6a6d03fa0e6 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BackboneElement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java index b6a9a6d8013..a4be3283e9f 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Base64BinaryType.java @@ -51,6 +51,13 @@ public class Base64BinaryType extends PrimitiveType { setValue(theBytes); } + /** + * Constructor + */ + public Base64BinaryType(String theValue) { + setValueAsString(theValue); + } + @Override protected byte[] parse(String theValue) { return Base64.decodeBase64(theValue); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java index bd087891ac6..a310d0e75cc 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BaseDateTimeType.java @@ -20,6 +20,8 @@ package org.hl7.fhir.instance.model; * #L% */ +import static org.hl7.fhir.instance.model.TemporalPrecisionEnum.*; + import java.text.ParseException; import java.util.ArrayList; import java.util.Calendar; @@ -30,15 +32,11 @@ import java.util.List; import java.util.TimeZone; import java.util.regex.Pattern; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.FastDateFormat; -import ca.uhn.fhir.model.api.BasePrimitive; -import ca.uhn.fhir.parser.DataFormatException; - -import static org.hl7.fhir.instance.model.TemporalPrecisionEnum.*; - public abstract class BaseDateTimeType extends PrimitiveType { private static final long serialVersionUID = 1L; @@ -64,6 +62,12 @@ public abstract class BaseDateTimeType extends PrimitiveType { private static final FastDateFormat ourYearMonthNoDashesFormat = FastDateFormat.getInstance("yyyyMM"); private static final Pattern ourYearMonthPattern = Pattern.compile("[0-9]{4}[0-9]{2}"); private static final Pattern ourYearPattern = Pattern.compile("[0-9]{4}"); + private static final FastDateFormat ourYearMonthDayTimeMinsFormat = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm"); + private static final FastDateFormat ourYearMonthDayTimeMinsUTCZFormat = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")); + private static final FastDateFormat ourYearMonthDayTimeMinsZoneFormat = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mmZZ"); + + private static final FastDateFormat ourHumanDateTimeFormat = FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM); + private static final FastDateFormat ourHumanDateFormat = FastDateFormat.getDateInstance(FastDateFormat.MEDIUM); static { ArrayList formatters = new ArrayList(); @@ -71,11 +75,14 @@ public abstract class BaseDateTimeType extends PrimitiveType { formatters.add(ourYearMonthDayFormat); formatters.add(ourYearMonthDayNoDashesFormat); formatters.add(ourYearMonthDayTimeFormat); - formatters.add(ourYearMonthDayTimeMilliFormat); formatters.add(ourYearMonthDayTimeUTCZFormat); + formatters.add(ourYearMonthDayTimeZoneFormat); + formatters.add(ourYearMonthDayTimeMilliFormat); formatters.add(ourYearMonthDayTimeMilliUTCZFormat); formatters.add(ourYearMonthDayTimeMilliZoneFormat); - formatters.add(ourYearMonthDayTimeZoneFormat); + formatters.add(ourYearMonthDayTimeMinsFormat); + formatters.add(ourYearMonthDayTimeMinsUTCZFormat); + formatters.add(ourYearMonthDayTimeMinsZoneFormat); formatters.add(ourYearMonthFormat); formatters.add(ourYearMonthNoDashesFormat); ourFormatters = Collections.unmodifiableList(formatters); @@ -96,26 +103,26 @@ public abstract class BaseDateTimeType extends PrimitiveType { /** * Constructor * - * @throws DataFormatException + * @throws IllegalArgumentException * If the specified precision is not allowed for this type */ public BaseDateTimeType(Date theDate, TemporalPrecisionEnum thePrecision) { setValue(theDate, thePrecision); if (isPrecisionAllowed(thePrecision) == false) { - throw new DataFormatException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + thePrecision + " precision): " + theDate); + throw new IllegalArgumentException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + thePrecision + " precision): " + theDate); } } /** * Constructor * - * @throws DataFormatException + * @throws IllegalArgumentException * If the specified precision is not allowed for this type */ public BaseDateTimeType(String theString) { setValueAsString(theString); if (isPrecisionAllowed(getPrecision()) == false) { - throw new DataFormatException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + getPrecision() + " precision): " + theString); + throw new IllegalArgumentException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + getPrecision() + " precision): " + theString); } } @@ -144,6 +151,18 @@ public abstract class BaseDateTimeType extends PrimitiveType { return ourYearMonthFormat.format(theValue); case YEAR: return ourYearFormat.format(theValue); + case MINUTE: + if (myTimeZoneZulu) { + GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT")); + cal.setTime(theValue); + return ourYearMonthDayTimeMinsFormat.format(cal) + "Z"; + } else if (myTimeZone != null) { + GregorianCalendar cal = new GregorianCalendar(myTimeZone); + cal.setTime(theValue); + return (ourYearMonthDayTimeMinsZoneFormat.format(cal)); + } else { + return ourYearMonthDayTimeMinsFormat.format(theValue); + } case SECOND: if (myTimeZoneZulu) { GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT")); @@ -152,7 +171,7 @@ public abstract class BaseDateTimeType extends PrimitiveType { } else if (myTimeZone != null) { GregorianCalendar cal = new GregorianCalendar(myTimeZone); cal.setTime(theValue); - return ourYearMonthDayTimeZoneFormat.format(cal); + return (ourYearMonthDayTimeZoneFormat.format(cal)); } else { return ourYearMonthDayTimeFormat.format(theValue); } @@ -164,7 +183,7 @@ public abstract class BaseDateTimeType extends PrimitiveType { } else if (myTimeZone != null) { GregorianCalendar cal = new GregorianCalendar(myTimeZone); cal.setTime(theValue); - return ourYearMonthDayTimeMilliZoneFormat.format(cal); + return (ourYearMonthDayTimeMilliZoneFormat.format(cal)); } else { return ourYearMonthDayTimeMilliFormat.format(theValue); } @@ -237,11 +256,12 @@ public abstract class BaseDateTimeType extends PrimitiveType { } @Override - protected Date parse(String theValue) throws DataFormatException { + protected Date parse(String theValue) throws IllegalArgumentException { try { if (theValue.length() == 4 && ourYearPattern.matcher(theValue).matches()) { if (!isPrecisionAllowed(YEAR)) { -// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support YEAR precision): " + theValue); + // ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + + // " does not support YEAR precision): " + theValue); } setPrecision(YEAR); clearTimeZone(); @@ -249,7 +269,8 @@ public abstract class BaseDateTimeType extends PrimitiveType { } else if (theValue.length() == 6 && ourYearMonthPattern.matcher(theValue).matches()) { // Eg. 198401 (allow this just to be lenient) if (!isPrecisionAllowed(MONTH)) { -// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support DAY precision): " + theValue); + // ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + + // " does not support DAY precision): " + theValue); } setPrecision(MONTH); clearTimeZone(); @@ -257,7 +278,8 @@ public abstract class BaseDateTimeType extends PrimitiveType { } else if (theValue.length() == 7 && ourYearDashMonthPattern.matcher(theValue).matches()) { // E.g. 1984-01 (this is valid according to the spec) if (!isPrecisionAllowed(MONTH)) { -// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support MONTH precision): " + theValue); + // ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + + // " does not support MONTH precision): " + theValue); } setPrecision(MONTH); clearTimeZone(); @@ -265,7 +287,8 @@ public abstract class BaseDateTimeType extends PrimitiveType { } else if (theValue.length() == 8 && ourYearMonthDayPattern.matcher(theValue).matches()) { // Eg. 19840101 (allow this just to be lenient) if (!isPrecisionAllowed(DAY)) { -// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support DAY precision): " + theValue); + // ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + + // " does not support DAY precision): " + theValue); } setPrecision(DAY); clearTimeZone(); @@ -273,20 +296,30 @@ public abstract class BaseDateTimeType extends PrimitiveType { } else if (theValue.length() == 10 && ourYearDashMonthDashDayPattern.matcher(theValue).matches()) { // E.g. 1984-01-01 (this is valid according to the spec) if (!isPrecisionAllowed(DAY)) { -// ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support DAY precision): " + theValue); + // ourLog.debug("Invalid date/time string (datatype " + getClass().getSimpleName() + + // " does not support DAY precision): " + theValue); } setPrecision(DAY); clearTimeZone(); return ((ourYearMonthDayFormat).parse(theValue)); - } else if (theValue.length() >= 18) { // date and time with possible time zone - int dotIndex = theValue.indexOf('.', 18); + } else if (theValue.length() >= 16) { // date and time with possible time zone + int firstColonIndex = theValue.indexOf(':'); + if (firstColonIndex == -1) { + throw new IllegalArgumentException("Invalid date/time string: " + theValue); + } + + boolean hasSeconds = theValue.length() > firstColonIndex+3 ? theValue.charAt(firstColonIndex+3) == ':' : false; + + int dotIndex = theValue.length() >= 18 ? theValue.indexOf('.', 18): -1; boolean hasMillis = dotIndex > -1; - if (!hasMillis && !isPrecisionAllowed(SECOND)) { -// ourLog.debug("Invalid date/time string (data type does not support SECONDS precision): " + theValue); - } else if (hasMillis && !isPrecisionAllowed(MILLI)) { -// ourLog.debug("Invalid date/time string (data type " + getClass().getSimpleName() + " does not support MILLIS precision):" + theValue); - } +// if (!hasMillis && !isPrecisionAllowed(SECOND)) { + // ourLog.debug("Invalid date/time string (data type does not support SECONDS precision): " + + // theValue); +// } else if (hasMillis && !isPrecisionAllowed(MILLI)) { + // ourLog.debug("Invalid date/time string (data type " + getClass().getSimpleName() + + // " does not support MILLIS precision):" + theValue); +// } Date retVal; if (hasMillis) { @@ -299,11 +332,11 @@ public abstract class BaseDateTimeType extends PrimitiveType { retVal = ourYearMonthDayTimeMilliFormat.parse(theValue); } } catch (ParseException p2) { - throw new DataFormatException("Invalid data/time string (" + p2.getMessage() + "): " + theValue); + throw new IllegalArgumentException("Invalid data/time string (" + p2.getMessage() + "): " + theValue); } setTimeZone(theValue, hasMillis); setPrecision(TemporalPrecisionEnum.MILLI); - } else { + } else if (hasSeconds) { try { if (hasOffset(theValue)) { retVal = ourYearMonthDayTimeZoneFormat.parse(theValue); @@ -313,19 +346,34 @@ public abstract class BaseDateTimeType extends PrimitiveType { retVal = ourYearMonthDayTimeFormat.parse(theValue); } } catch (ParseException p2) { - throw new DataFormatException("Invalid data/time string (" + p2.getMessage() + "): " + theValue); + throw new IllegalArgumentException("Invalid data/time string (" + p2.getMessage() + "): " + theValue); } setTimeZone(theValue, hasMillis); setPrecision(TemporalPrecisionEnum.SECOND); + } else { + try { + if (hasOffset(theValue)) { + retVal = ourYearMonthDayTimeMinsZoneFormat.parse(theValue); + } else if (theValue.endsWith("Z")) { + retVal = ourYearMonthDayTimeMinsUTCZFormat.parse(theValue); + } else { + retVal = ourYearMonthDayTimeMinsFormat.parse(theValue); + } + } catch (ParseException p2) { + throw new IllegalArgumentException("Invalid data/time string (" + p2.getMessage() + "): " + theValue, p2); + } + + setTimeZone(theValue, hasMillis); + setPrecision(TemporalPrecisionEnum.MINUTE); } return retVal; } else { - throw new DataFormatException("Invalid date/time string (invalid length): " + theValue); + throw new IllegalArgumentException("Invalid date/time string (invalid length): " + theValue); } } catch (ParseException e) { - throw new DataFormatException("Invalid date string (" + e.getMessage() + "): " + theValue); + throw new IllegalArgumentException("Invalid date string (" + e.getMessage() + "): " + theValue); } } @@ -338,9 +386,9 @@ public abstract class BaseDateTimeType extends PrimitiveType { *
  • {@link Calendar#YEAR} * * - * @throws DataFormatException + * @throws IllegalArgumentException */ - public void setPrecision(TemporalPrecisionEnum thePrecision) throws DataFormatException { + public void setPrecision(TemporalPrecisionEnum thePrecision) throws IllegalArgumentException { if (thePrecision == null) { throw new NullPointerException("Precision may not be null"); } @@ -373,9 +421,9 @@ public abstract class BaseDateTimeType extends PrimitiveType { } @Override - public void setValue(Date theValue) { + public BaseDateTimeType setValue(Date theValue) { clearTimeZone(); - super.setValue(theValue); + return (BaseDateTimeType) super.setValue(theValue); } /** @@ -385,16 +433,16 @@ public abstract class BaseDateTimeType extends PrimitiveType { * The date value * @param thePrecision * The precision - * @throws DataFormatException + * @throws IllegalArgumentException */ - public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws DataFormatException { + public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws IllegalArgumentException { clearTimeZone(); super.setValue(theValue); myPrecision = thePrecision; } @Override - public void setValueAsString(String theValue) throws DataFormatException { + public void setValueAsString(String theValue) throws IllegalArgumentException { clearTimeZone(); super.setValueAsString(theValue); } @@ -406,4 +454,136 @@ public abstract class BaseDateTimeType extends PrimitiveType { return ourFormatters; } + public boolean before(DateTimeType theDateTimeType) { + return getValue().before(theDateTimeType.getValue()); + } + + public boolean after(DateTimeType theDateTimeType) { + return getValue().after(theDateTimeType.getValue()); + } + + /** + * Returns a human readable version of this date/time using the system local format + */ + public String toHumanDisplay() { + switch (getPrecision()) { + case YEAR: + case MONTH: + case DAY: + return ourHumanDateFormat.format(getValue()); + case MILLI: + case SECOND: + default: + return ourHumanDateTimeFormat.format(getValue()); + } + } + + /** + * Returns a view of this date/time as a Calendar object + */ + public Calendar toCalendar() { + Calendar retVal = Calendar.getInstance(); + retVal.setTime(getValue()); + retVal.setTimeZone(getTimeZone()); + return retVal; + } + + /** + * Sets the TimeZone offset in minutes relative to GMT + */ + public void setOffsetMinutes(int theZoneOffsetMinutes) { + int offsetAbs = Math.abs(theZoneOffsetMinutes); + + int mins = offsetAbs % 60; + int hours = offsetAbs / 60; + + if (theZoneOffsetMinutes < 0) { + setTimeZone(TimeZone.getTimeZone("GMT-" + hours + ":" + mins)); + } else { + setTimeZone(TimeZone.getTimeZone("GMT+" + hours + ":" + mins)); + } + } + + /** + * Returns the time in millis as represented by this Date/Time + */ + public long getTime() { + return getValue().getTime(); + } + + /** + * Adds the given amount to the field specified by theField + * + * @param theField + * The field, uses constants from {@link Calendar} such as {@link Calendar#YEAR} + * @param theValue + * The number to add (or subtract for a negative number) + */ + public void add(int theField, int theValue) { + switch (theField) { + case Calendar.YEAR: + setValue(DateUtils.addYears(getValue(), theValue), getPrecision()); + break; + case Calendar.MONTH: + setValue(DateUtils.addMonths(getValue(), theValue), getPrecision()); + break; + case Calendar.DATE: + setValue(DateUtils.addDays(getValue(), theValue), getPrecision()); + break; + case Calendar.HOUR: + setValue(DateUtils.addHours(getValue(), theValue), getPrecision()); + break; + case Calendar.MINUTE: + setValue(DateUtils.addMinutes(getValue(), theValue), getPrecision()); + break; + case Calendar.SECOND: + setValue(DateUtils.addSeconds(getValue(), theValue), getPrecision()); + break; + case Calendar.MILLISECOND: + setValue(DateUtils.addMilliseconds(getValue(), theValue), getPrecision()); + break; + default: + throw new IllegalArgumentException("Unknown field constant: " + theField); + } + } + + protected void setValueAsV3String(String theV3String) { + if (StringUtils.isBlank(theV3String)) { + setValue(null); + } else { + StringBuilder b = new StringBuilder(); + String timeZone = null; + for (int i = 0; i < theV3String.length(); i++) { + char nextChar = theV3String.charAt(i); + if (nextChar == '+' || nextChar == '-' || nextChar == 'Z') { + timeZone = (theV3String.substring(i)); + break; + } + + // assertEquals("2013-02-02T20:13:03-05:00", DateAndTime.parseV3("20130202201303-0500").toString()); + if (i == 4 || i == 6) { + b.append('-'); + } else if (i == 8) { + b.append('T'); + } else if (i == 10 || i == 12) { + b.append(':'); + } + + b.append(nextChar); + } + + if (timeZone != null && b.length() > 10) { + if (timeZone.length() ==5) { + b.append(timeZone.substring(0, 3)); + b.append(':'); + b.append(timeZone.substring(3)); + }else { + b.append(timeZone); + } + } + + setValueAsString(b.toString()); + } + } + } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Basic.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Basic.java index 12af731724c..d88da33b1c0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Basic.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Basic.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -263,14 +263,14 @@ public class Basic extends DomainResource { /** * @return Identifies when the resource was first created. */ - public DateAndTime getCreated() { + public Date getCreated() { return this.created == null ? null : this.created.getValue(); } /** * @param value Identifies when the resource was first created. */ - public Basic setCreated(DateAndTime value) { + public Basic setCreated(Date value) { if (value == null) this.created = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Binary.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Binary.java index dbb947852c3..31cee0103f6 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Binary.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Binary.java @@ -29,12 +29,14 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; +import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.instance.model.annotations.ResourceDef; import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; import org.hl7.fhir.instance.model.annotations.Child; import org.hl7.fhir.instance.model.annotations.Description; /** diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BooleanType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BooleanType.java index 16acd45eba9..74e7d183808 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BooleanType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/BooleanType.java @@ -33,8 +33,6 @@ package org.hl7.fhir.instance.model; import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import ca.uhn.fhir.parser.DataFormatException; - /** * Primitive type "boolean" in FHIR "true" or "false" */ @@ -66,12 +64,13 @@ public class BooleanType extends PrimitiveType { @Override protected Boolean parse(String theValue) { - if ("true".equals(theValue)) { + String value = theValue.trim(); + if ("true".equals(value)) { return Boolean.TRUE; - } else if ("false".equals(theValue)) { + } else if ("false".equals(value)) { return Boolean.FALSE; } else { - throw new DataFormatException("Invalid boolean string: '" + theValue + "'"); + throw new IllegalArgumentException("Invalid boolean string: '" + theValue + "'"); } } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Bundle.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Bundle.java index bf6cff65d2f..1a0c8603b00 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Bundle.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Bundle.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -46,7 +46,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle") public class Bundle extends Resource { - public enum BundleType { + public enum BundleType implements FhirEnum { /** * The bundle is a document. The first resource is a Composition. */ @@ -79,7 +79,10 @@ public class Bundle extends Resource { * added to help the parsers */ NULL; - public static BundleType fromCode(String codeString) throws Exception { + + public static final BundleTypeEnumFactory ENUM_FACTORY = new BundleTypeEnumFactory(); + + public static BundleType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("document".equals(codeString)) @@ -96,8 +99,9 @@ public class Bundle extends Resource { return SEARCHSET; if ("collection".equals(codeString)) return COLLECTION; - throw new Exception("Unknown BundleType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DOCUMENT: return "document"; @@ -148,8 +152,8 @@ public class Bundle extends Resource { } } - public static class BundleTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class BundleTypeEnumFactory implements EnumFactory { + public BundleType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -167,9 +171,9 @@ public class Bundle extends Resource { return BundleType.SEARCHSET; if ("collection".equals(codeString)) return BundleType.COLLECTION; - throw new Exception("Unknown BundleType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(BundleType code) throws IllegalArgumentException { if (code == BundleType.DOCUMENT) return "document"; if (code == BundleType.MESSAGE) @@ -188,7 +192,7 @@ public class Bundle extends Resource { } } - public enum BundleEntryStatus { + public enum BundleEntryStatus implements FhirEnum { /** * Transaction: perform a create operation on this resource. */ @@ -209,7 +213,10 @@ public class Bundle extends Resource { * added to help the parsers */ NULL; - public static BundleEntryStatus fromCode(String codeString) throws Exception { + + public static final BundleEntryStatusEnumFactory ENUM_FACTORY = new BundleEntryStatusEnumFactory(); + + public static BundleEntryStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("create".equals(codeString)) @@ -220,8 +227,9 @@ public class Bundle extends Resource { return MATCH; if ("include".equals(codeString)) return INCLUDE; - throw new Exception("Unknown BundleEntryStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown BundleEntryStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case CREATE: return "create"; @@ -260,8 +268,8 @@ public class Bundle extends Resource { } } - public static class BundleEntryStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class BundleEntryStatusEnumFactory implements EnumFactory { + public BundleEntryStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -273,9 +281,9 @@ public class Bundle extends Resource { return BundleEntryStatus.MATCH; if ("include".equals(codeString)) return BundleEntryStatus.INCLUDE; - throw new Exception("Unknown BundleEntryStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown BundleEntryStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(BundleEntryStatus code) throws IllegalArgumentException { if (code == BundleEntryStatus.CREATE) return "create"; if (code == BundleEntryStatus.UPDATE) @@ -569,7 +577,7 @@ public class Bundle extends Resource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(BundleEntryStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -758,9 +766,9 @@ public class Bundle extends Resource { /** * The id of the resource that was deleted. */ - @Child(name="id", type={IdType.class}, order=2, min=1, max=1) + @Child(name="resourceId", type={IdType.class}, order=2, min=1, max=1) @Description(shortDefinition="Id of resource that was deleted", formalDefinition="The id of the resource that was deleted." ) - protected IdType id; + protected IdType resourceId; /** * Version id for releted resource. @@ -776,16 +784,16 @@ public class Bundle extends Resource { @Description(shortDefinition="When the resource was deleted", formalDefinition="The date/time that the resource was deleted." ) protected InstantType instant; - private static final long serialVersionUID = 1013425873L; + private static final long serialVersionUID = -1528107649L; public BundleEntryDeletedComponent() { super(); } - public BundleEntryDeletedComponent(CodeType type, IdType id, IdType versionId, InstantType instant) { + public BundleEntryDeletedComponent(CodeType type, IdType resourceId, IdType versionId, InstantType instant) { super(); this.type = type; - this.id = id; + this.resourceId = resourceId; this.versionId = versionId; this.instant = instant; } @@ -836,47 +844,47 @@ public class Bundle extends Resource { } /** - * @return {@link #id} (The id of the resource that was deleted.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + * @return {@link #resourceId} (The id of the resource that was deleted.). This is the underlying object with id, value and extensions. The accessor "getResourceId" gives direct access to the value */ - public IdType getIdElement() { - if (this.id == null) + public IdType getResourceIdElement() { + if (this.resourceId == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryDeletedComponent.id"); + throw new Error("Attempt to auto-create BundleEntryDeletedComponent.resourceId"); else if (Configuration.doAutoCreate()) - this.id = new IdType(); - return this.id; + this.resourceId = new IdType(); + return this.resourceId; } - public boolean hasIdElement() { - return this.id != null && !this.id.isEmpty(); + public boolean hasResourceIdElement() { + return this.resourceId != null && !this.resourceId.isEmpty(); } - public boolean hasId() { - return this.id != null && !this.id.isEmpty(); + public boolean hasResourceId() { + return this.resourceId != null && !this.resourceId.isEmpty(); } /** - * @param value {@link #id} (The id of the resource that was deleted.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value + * @param value {@link #resourceId} (The id of the resource that was deleted.). This is the underlying object with id, value and extensions. The accessor "getResourceId" gives direct access to the value */ - public BundleEntryDeletedComponent setIdElement(IdType value) { - this.id = value; + public BundleEntryDeletedComponent setResourceIdElement(IdType value) { + this.resourceId = value; return this; } /** * @return The id of the resource that was deleted. */ - public String getId() { - return this.id == null ? null : this.id.getValue(); + public String getResourceId() { + return this.resourceId == null ? null : this.resourceId.getValue(); } /** * @param value The id of the resource that was deleted. */ - public BundleEntryDeletedComponent setId(String value) { - if (this.id == null) - this.id = new IdType(); - this.id.setValue(value); + public BundleEntryDeletedComponent setResourceId(String value) { + if (this.resourceId == null) + this.resourceId = new IdType(); + this.resourceId.setValue(value); return this; } @@ -956,14 +964,14 @@ public class Bundle extends Resource { /** * @return The date/time that the resource was deleted. */ - public DateAndTime getInstant() { + public Date getInstant() { return this.instant == null ? null : this.instant.getValue(); } /** * @param value The date/time that the resource was deleted. */ - public BundleEntryDeletedComponent setInstant(DateAndTime value) { + public BundleEntryDeletedComponent setInstant(Date value) { if (this.instant == null) this.instant = new InstantType(); this.instant.setValue(value); @@ -973,7 +981,7 @@ public class Bundle extends Resource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("type", "code", "The type of resource that was deleted (required to construct the identity).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("id", "id", "The id of the resource that was deleted.", 0, java.lang.Integer.MAX_VALUE, id)); + childrenList.add(new Property("resourceId", "id", "The id of the resource that was deleted.", 0, java.lang.Integer.MAX_VALUE, resourceId)); childrenList.add(new Property("versionId", "id", "Version id for releted resource.", 0, java.lang.Integer.MAX_VALUE, versionId)); childrenList.add(new Property("instant", "instant", "The date/time that the resource was deleted.", 0, java.lang.Integer.MAX_VALUE, instant)); } @@ -982,15 +990,15 @@ public class Bundle extends Resource { BundleEntryDeletedComponent dst = new BundleEntryDeletedComponent(); copyValues(dst); dst.type = type == null ? null : type.copy(); - dst.id = id == null ? null : id.copy(); + dst.resourceId = resourceId == null ? null : resourceId.copy(); dst.versionId = versionId == null ? null : versionId.copy(); dst.instant = instant == null ? null : instant.copy(); return dst; } public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (id == null || id.isEmpty()) && (versionId == null || versionId.isEmpty()) - && (instant == null || instant.isEmpty()); + return super.isEmpty() && (type == null || type.isEmpty()) && (resourceId == null || resourceId.isEmpty()) + && (versionId == null || versionId.isEmpty()) && (instant == null || instant.isEmpty()); } } @@ -1088,7 +1096,7 @@ public class Bundle extends Resource { */ public Bundle setType(BundleType value) { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(BundleType.ENUM_FACTORY); this.type.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CareActivity.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CareActivity.java new file mode 100644 index 00000000000..1814fae3c24 --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CareActivity.java @@ -0,0 +1,1322 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + */ +@ResourceDef(name="CareActivity", profile="http://hl7.org/fhir/Profile/CareActivity") +public class CareActivity extends DomainResource { + + public enum CareActivityStatus implements FhirEnum { + /** + * Activity is planned but no action has yet been taken. + */ + NOTSTARTED, + /** + * Appointment or other booking has occurred but activity has not yet begun. + */ + SCHEDULED, + /** + * Activity has been started but is not yet complete. + */ + INPROGRESS, + /** + * Activity was started but has temporarily ceased with an expectation of resumption at a future time. + */ + ONHOLD, + /** + * The activities have been completed (more or less) as planned. + */ + COMPLETED, + /** + * The activities have been ended prior to completion (perhaps even before they were started). + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + + public static final CareActivityStatusEnumFactory ENUM_FACTORY = new CareActivityStatusEnumFactory(); + + public static CareActivityStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("not started".equals(codeString)) + return NOTSTARTED; + if ("scheduled".equals(codeString)) + return SCHEDULED; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("on hold".equals(codeString)) + return ONHOLD; + if ("completed".equals(codeString)) + return COMPLETED; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new IllegalArgumentException("Unknown CareActivityStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case NOTSTARTED: return "not started"; + case SCHEDULED: return "scheduled"; + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTSTARTED: return ""; + case SCHEDULED: return ""; + case INPROGRESS: return ""; + case ONHOLD: return ""; + case COMPLETED: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTSTARTED: return "Activity is planned but no action has yet been taken."; + case SCHEDULED: return "Appointment or other booking has occurred but activity has not yet begun."; + case INPROGRESS: return "Activity has been started but is not yet complete."; + case ONHOLD: return "Activity was started but has temporarily ceased with an expectation of resumption at a future time."; + case COMPLETED: return "The activities have been completed (more or less) as planned."; + case CANCELLED: return "The activities have been ended prior to completion (perhaps even before they were started)."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTSTARTED: return "not started"; + case SCHEDULED: return "scheduled"; + case INPROGRESS: return "in progress"; + case ONHOLD: return "on hold"; + case COMPLETED: return "completed"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + } + + public static class CareActivityStatusEnumFactory implements EnumFactory { + public CareActivityStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not started".equals(codeString)) + return CareActivityStatus.NOTSTARTED; + if ("scheduled".equals(codeString)) + return CareActivityStatus.SCHEDULED; + if ("in progress".equals(codeString)) + return CareActivityStatus.INPROGRESS; + if ("on hold".equals(codeString)) + return CareActivityStatus.ONHOLD; + if ("completed".equals(codeString)) + return CareActivityStatus.COMPLETED; + if ("cancelled".equals(codeString)) + return CareActivityStatus.CANCELLED; + throw new IllegalArgumentException("Unknown CareActivityStatus code '"+codeString+"'"); + } + public String toCode(CareActivityStatus code) throws IllegalArgumentException { + if (code == CareActivityStatus.NOTSTARTED) + return "not started"; + if (code == CareActivityStatus.SCHEDULED) + return "scheduled"; + if (code == CareActivityStatus.INPROGRESS) + return "in progress"; + if (code == CareActivityStatus.ONHOLD) + return "on hold"; + if (code == CareActivityStatus.COMPLETED) + return "completed"; + if (code == CareActivityStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + public enum CareActivityCategory implements FhirEnum { + /** + * Plan for the patient to consume food of a specified nature. + */ + DIET, + /** + * Plan for the patient to consume/receive a drug, vaccine or other product. + */ + DRUG, + /** + * Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.). + */ + ENCOUNTER, + /** + * Plan to capture information about a patient (vitals, labs, diagnostic images, etc.). + */ + OBSERVATION, + /** + * Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.). + */ + PROCEDURE, + /** + * Plan to provide something to the patient (medication, medical supply, etc.). + */ + SUPPLY, + /** + * Some other form of action. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + public static final CareActivityCategoryEnumFactory ENUM_FACTORY = new CareActivityCategoryEnumFactory(); + + public static CareActivityCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("diet".equals(codeString)) + return DIET; + if ("drug".equals(codeString)) + return DRUG; + if ("encounter".equals(codeString)) + return ENCOUNTER; + if ("observation".equals(codeString)) + return OBSERVATION; + if ("procedure".equals(codeString)) + return PROCEDURE; + if ("supply".equals(codeString)) + return SUPPLY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown CareActivityCategory code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case DIET: return "diet"; + case DRUG: return "drug"; + case ENCOUNTER: return "encounter"; + case OBSERVATION: return "observation"; + case PROCEDURE: return "procedure"; + case SUPPLY: return "supply"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case DIET: return ""; + case DRUG: return ""; + case ENCOUNTER: return ""; + case OBSERVATION: return ""; + case PROCEDURE: return ""; + case SUPPLY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case DIET: return "Plan for the patient to consume food of a specified nature."; + case DRUG: return "Plan for the patient to consume/receive a drug, vaccine or other product."; + case ENCOUNTER: return "Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.)."; + case OBSERVATION: return "Plan to capture information about a patient (vitals, labs, diagnostic images, etc.)."; + case PROCEDURE: return "Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.)."; + case SUPPLY: return "Plan to provide something to the patient (medication, medical supply, etc.)."; + case OTHER: return "Some other form of action."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case DIET: return "diet"; + case DRUG: return "drug"; + case ENCOUNTER: return "encounter"; + case OBSERVATION: return "observation"; + case PROCEDURE: return "procedure"; + case SUPPLY: return "supply"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class CareActivityCategoryEnumFactory implements EnumFactory { + public CareActivityCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("diet".equals(codeString)) + return CareActivityCategory.DIET; + if ("drug".equals(codeString)) + return CareActivityCategory.DRUG; + if ("encounter".equals(codeString)) + return CareActivityCategory.ENCOUNTER; + if ("observation".equals(codeString)) + return CareActivityCategory.OBSERVATION; + if ("procedure".equals(codeString)) + return CareActivityCategory.PROCEDURE; + if ("supply".equals(codeString)) + return CareActivityCategory.SUPPLY; + if ("other".equals(codeString)) + return CareActivityCategory.OTHER; + throw new IllegalArgumentException("Unknown CareActivityCategory code '"+codeString+"'"); + } + public String toCode(CareActivityCategory code) throws IllegalArgumentException { + if (code == CareActivityCategory.DIET) + return "diet"; + if (code == CareActivityCategory.DRUG) + return "drug"; + if (code == CareActivityCategory.ENCOUNTER) + return "encounter"; + if (code == CareActivityCategory.OBSERVATION) + return "observation"; + if (code == CareActivityCategory.PROCEDURE) + return "procedure"; + if (code == CareActivityCategory.SUPPLY) + return "supply"; + if (code == CareActivityCategory.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class CareActivitySimpleComponent extends BackboneElement { + /** + * High-level categorization of the type of activity in a care plan. + */ + @Child(name="category", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." ) + protected Enumeration category; + + /** + * Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter. + */ + @Child(name="code", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter." ) + protected CodeableConcept code; + + /** + * The period, timing or frequency upon which the described activity is to occur. + */ + @Child(name="scheduled", type={Timing.class, Period.class, StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) + protected Type scheduled; + + /** + * Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. + */ + @Child(name="location", type={Location.class}, order=4, min=0, max=1) + @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc." ) + protected Reference location; + + /** + * The actual object that is the target of the reference (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + protected Location locationTarget; + + /** + * Identifies who's expected to be involved in the activity. + */ + @Child(name="performer", type={Practitioner.class, Organization.class, RelatedPerson.class, Patient.class}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who's responsible?", formalDefinition="Identifies who's expected to be involved in the activity." ) + protected List performer; + /** + * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.) + */ + protected List performerTarget; + + + /** + * Identifies the food, drug or other product being consumed or supplied in the activity. + */ + @Child(name="product", type={Medication.class, Substance.class}, order=6, min=0, max=1) + @Description(shortDefinition="What's administered/supplied", formalDefinition="Identifies the food, drug or other product being consumed or supplied in the activity." ) + protected Reference product; + + /** + * The actual object that is the target of the reference (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + protected Resource productTarget; + + /** + * Identifies the quantity expected to be consumed in a given day. + */ + @Child(name="dailyAmount", type={Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="How much consumed/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." ) + protected Quantity dailyAmount; + + /** + * Identifies the quantity expected to be supplied. + */ + @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="How much is administered/supplied/consumed", formalDefinition="Identifies the quantity expected to be supplied." ) + protected Quantity quantity; + + /** + * This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + @Child(name="details", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Extra info on activity occurrence", formalDefinition="This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc." ) + protected StringType details; + + private static final long serialVersionUID = -17133504L; + + public CareActivitySimpleComponent() { + super(); + } + + public CareActivitySimpleComponent(Enumeration category) { + super(); + this.category = category; + } + + /** + * @return {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(); + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (High-level categorization of the type of activity in a care plan.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public CareActivitySimpleComponent setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return High-level categorization of the type of activity in a care plan. + */ + public CareActivityCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value High-level categorization of the type of activity in a care plan. + */ + public CareActivitySimpleComponent setCategory(CareActivityCategory value) { + if (this.category == null) + this.category = new Enumeration(CareActivityCategory.ENUM_FACTORY); + this.category.setValue(value); + return this; + } + + /** + * @return {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.) + */ + public CareActivitySimpleComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Type getScheduled() { + return this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Timing getScheduledTiming() throws Exception { + if (!(this.scheduled instanceof Timing)) + throw new Exception("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Timing) this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public Period getScheduledPeriod() throws Exception { + if (!(this.scheduled instanceof Period)) + throw new Exception("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (Period) this.scheduled; + } + + /** + * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public StringType getScheduledStringType() throws Exception { + if (!(this.scheduled instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); + return (StringType) this.scheduled; + } + + public boolean hasScheduled() { + return this.scheduled != null && !this.scheduled.isEmpty(); + } + + /** + * @param value {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) + */ + public CareActivitySimpleComponent setScheduled(Type value) { + this.scheduled = value; + return this; + } + + /** + * @return {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public Reference getLocation() { + if (this.location == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.location"); + else if (Configuration.doAutoCreate()) + this.location = new Reference(); + return this.location; + } + + public boolean hasLocation() { + return this.location != null && !this.location.isEmpty(); + } + + /** + * @param value {@link #location} (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public CareActivitySimpleComponent setLocation(Reference value) { + this.location = value; + return this; + } + + /** + * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public Location getLocationTarget() { + if (this.locationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.location"); + else if (Configuration.doAutoCreate()) + this.locationTarget = new Location(); + return this.locationTarget; + } + + /** + * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.) + */ + public CareActivitySimpleComponent setLocationTarget(Location value) { + this.locationTarget = value; + return this; + } + + /** + * @return {@link #performer} (Identifies who's expected to be involved in the activity.) + */ + public List getPerformer() { + if (this.performer == null) + this.performer = new ArrayList(); + return this.performer; + } + + public boolean hasPerformer() { + if (this.performer == null) + return false; + for (Reference item : this.performer) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #performer} (Identifies who's expected to be involved in the activity.) + */ + // syntactic sugar + public Reference addPerformer() { //3 + Reference t = new Reference(); + if (this.performer == null) + this.performer = new ArrayList(); + this.performer.add(t); + return t; + } + + /** + * @return {@link #performer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who's expected to be involved in the activity.) + */ + public List getPerformerTarget() { + if (this.performerTarget == null) + this.performerTarget = new ArrayList(); + return this.performerTarget; + } + + /** + * @return {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + public Reference getProduct() { + if (this.product == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.product"); + else if (Configuration.doAutoCreate()) + this.product = new Reference(); + return this.product; + } + + public boolean hasProduct() { + return this.product != null && !this.product.isEmpty(); + } + + /** + * @param value {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + public CareActivitySimpleComponent setProduct(Reference value) { + this.product = value; + return this; + } + + /** + * @return {@link #product} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + public Resource getProductTarget() { + return this.productTarget; + } + + /** + * @param value {@link #product} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the food, drug or other product being consumed or supplied in the activity.) + */ + public CareActivitySimpleComponent setProductTarget(Resource value) { + this.productTarget = value; + return this; + } + + /** + * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) + */ + public Quantity getDailyAmount() { + if (this.dailyAmount == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.dailyAmount"); + else if (Configuration.doAutoCreate()) + this.dailyAmount = new Quantity(); + return this.dailyAmount; + } + + public boolean hasDailyAmount() { + return this.dailyAmount != null && !this.dailyAmount.isEmpty(); + } + + /** + * @param value {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) + */ + public CareActivitySimpleComponent setDailyAmount(Quantity value) { + this.dailyAmount = value; + return this; + } + + /** + * @return {@link #quantity} (Identifies the quantity expected to be supplied.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (Identifies the quantity expected to be supplied.) + */ + public CareActivitySimpleComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public StringType getDetailsElement() { + if (this.details == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivitySimpleComponent.details"); + else if (Configuration.doAutoCreate()) + this.details = new StringType(); + return this.details; + } + + public boolean hasDetailsElement() { + return this.details != null && !this.details.isEmpty(); + } + + public boolean hasDetails() { + return this.details != null && !this.details.isEmpty(); + } + + /** + * @param value {@link #details} (This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDetails" gives direct access to the value + */ + public CareActivitySimpleComponent setDetailsElement(StringType value) { + this.details = value; + return this; + } + + /** + * @return This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + public String getDetails() { + return this.details == null ? null : this.details.getValue(); + } + + /** + * @param value This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + */ + public CareActivitySimpleComponent setDetails(String value) { + if (Utilities.noString(value)) + this.details = null; + else { + if (this.details == null) + this.details = new StringType(); + this.details.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("category", "code", "High-level categorization of the type of activity in a care plan.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("code", "CodeableConcept", "Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); + childrenList.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc.", 0, java.lang.Integer.MAX_VALUE, location)); + childrenList.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer)); + childrenList.add(new Property("product", "Reference(Medication|Substance)", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); + childrenList.add(new Property("dailyAmount", "Quantity", "Identifies the quantity expected to be consumed in a given day.", 0, java.lang.Integer.MAX_VALUE, dailyAmount)); + childrenList.add(new Property("quantity", "Quantity", "Identifies the quantity expected to be supplied.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("details", "string", "This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.", 0, java.lang.Integer.MAX_VALUE, details)); + } + + public CareActivitySimpleComponent copy() { + CareActivitySimpleComponent dst = new CareActivitySimpleComponent(); + copyValues(dst); + dst.category = category == null ? null : category.copy(); + dst.code = code == null ? null : code.copy(); + dst.scheduled = scheduled == null ? null : scheduled.copy(); + dst.location = location == null ? null : location.copy(); + if (performer != null) { + dst.performer = new ArrayList(); + for (Reference i : performer) + dst.performer.add(i.copy()); + }; + dst.product = product == null ? null : product.copy(); + dst.dailyAmount = dailyAmount == null ? null : dailyAmount.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.details = details == null ? null : details.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) + && (scheduled == null || scheduled.isEmpty()) && (location == null || location.isEmpty()) + && (performer == null || performer.isEmpty()) && (product == null || product.isEmpty()) && (dailyAmount == null || dailyAmount.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (details == null || details.isEmpty()); + } + + } + + /** + * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this plan", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * Identifies the patient/subject whose intended care is described by the plan. + */ + @Child(name="patient", type={Patient.class}, order=0, min=0, max=1) + @Description(shortDefinition="Who care plan is for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.) + */ + protected Patient patientTarget; + + /** + * Internal reference that identifies the goals that this activity is intended to contribute towards meeting. + */ + @Child(name="goal", type={Goal.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goals this activity relates to", formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting." ) + protected List goal; + /** + * The actual objects that are the target of the reference (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + protected List goalTarget; + + + /** + * Identifies what progress is being made for the specific activity. + */ + @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="not started | scheduled | in progress | on hold | completed | cancelled", formalDefinition="Identifies what progress is being made for the specific activity." ) + protected Enumeration status; + + /** + * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + @Child(name="prohibited", type={BooleanType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Do NOT do", formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan." ) + protected BooleanType prohibited; + + /** + * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. + */ + @Child(name="actionResulting", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Appointments, orders, etc.", formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc." ) + protected List actionResulting; + /** + * The actual objects that are the target of the reference (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + protected List actionResultingTarget; + + + /** + * Notes about the execution of the activity. + */ + @Child(name="notes", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Comments about the activity", formalDefinition="Notes about the execution of the activity." ) + protected StringType notes; + + /** + * The details of the proposed activity represented in a specific resource. + */ + @Child(name="detail", type={Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, Encounter.class, Supply.class}, order=6, min=0, max=1) + @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." ) + protected Reference detail; + + /** + * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.) + */ + protected Resource detailTarget; + + /** + * A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. + */ + @Child(name="simple", type={}, order=7, min=0, max=1) + @Description(shortDefinition="Activity details summarised here", formalDefinition="A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." ) + protected CareActivitySimpleComponent simple; + + private static final long serialVersionUID = 1711521518L; + + public CareActivity() { + super(); + } + + public CareActivity(BooleanType prohibited) { + super(); + this.prohibited = prohibited; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public CareActivity setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public CareActivity setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public List getGoal() { + if (this.goal == null) + this.goal = new ArrayList(); + return this.goal; + } + + public boolean hasGoal() { + if (this.goal == null) + return false; + for (Reference item : this.goal) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + // syntactic sugar + public Reference addGoal() { //3 + Reference t = new Reference(); + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return t; + } + + /** + * @return {@link #goal} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public List getGoalTarget() { + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + return this.goalTarget; + } + + // syntactic sugar + /** + * @return {@link #goal} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) + */ + public Goal addGoalTarget() { + Goal r = new Goal(); + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + this.goalTarget.add(r); + return r; + } + + /** + * @return {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CareActivity setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Identifies what progress is being made for the specific activity. + */ + public CareActivityStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Identifies what progress is being made for the specific activity. + */ + public CareActivity setStatus(CareActivityStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(CareActivityStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value + */ + public BooleanType getProhibitedElement() { + if (this.prohibited == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.prohibited"); + else if (Configuration.doAutoCreate()) + this.prohibited = new BooleanType(); + return this.prohibited; + } + + public boolean hasProhibitedElement() { + return this.prohibited != null && !this.prohibited.isEmpty(); + } + + public boolean hasProhibited() { + return this.prohibited != null && !this.prohibited.isEmpty(); + } + + /** + * @param value {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value + */ + public CareActivity setProhibitedElement(BooleanType value) { + this.prohibited = value; + return this; + } + + /** + * @return If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + public boolean getProhibited() { + return this.prohibited == null ? false : this.prohibited.getValue(); + } + + /** + * @param value If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + */ + public CareActivity setProhibited(boolean value) { + if (this.prohibited == null) + this.prohibited = new BooleanType(); + this.prohibited.setValue(value); + return this; + } + + /** + * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + public List getActionResulting() { + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + return this.actionResulting; + } + + public boolean hasActionResulting() { + if (this.actionResulting == null) + return false; + for (Reference item : this.actionResulting) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + // syntactic sugar + public Reference addActionResulting() { //3 + Reference t = new Reference(); + if (this.actionResulting == null) + this.actionResulting = new ArrayList(); + this.actionResulting.add(t); + return t; + } + + /** + * @return {@link #actionResulting} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) + */ + public List getActionResultingTarget() { + if (this.actionResultingTarget == null) + this.actionResultingTarget = new ArrayList(); + return this.actionResultingTarget; + } + + /** + * @return {@link #notes} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (Notes about the execution of the activity.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public CareActivity setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Notes about the execution of the activity. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Notes about the execution of the activity. + */ + public CareActivity setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + /** + * @return {@link #detail} (The details of the proposed activity represented in a specific resource.) + */ + public Reference getDetail() { + if (this.detail == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.detail"); + else if (Configuration.doAutoCreate()) + this.detail = new Reference(); + return this.detail; + } + + public boolean hasDetail() { + return this.detail != null && !this.detail.isEmpty(); + } + + /** + * @param value {@link #detail} (The details of the proposed activity represented in a specific resource.) + */ + public CareActivity setDetail(Reference value) { + this.detail = value; + return this; + } + + /** + * @return {@link #detail} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.) + */ + public Resource getDetailTarget() { + return this.detailTarget; + } + + /** + * @param value {@link #detail} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.) + */ + public CareActivity setDetailTarget(Resource value) { + this.detailTarget = value; + return this; + } + + /** + * @return {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CareActivitySimpleComponent getSimple() { + if (this.simple == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CareActivity.simple"); + else if (Configuration.doAutoCreate()) + this.simple = new CareActivitySimpleComponent(); + return this.simple; + } + + public boolean hasSimple() { + return this.simple != null && !this.simple.isEmpty(); + } + + /** + * @param value {@link #simple} (A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) + */ + public CareActivity setSimple(CareActivitySimpleComponent value) { + this.simple = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("goal", "Reference(Goal)", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal)); + childrenList.add(new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.", 0, java.lang.Integer.MAX_VALUE, prohibited)); + childrenList.add(new Property("actionResulting", "Reference(Any)", "Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.", 0, java.lang.Integer.MAX_VALUE, actionResulting)); + childrenList.add(new Property("notes", "string", "Notes about the execution of the activity.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("detail", "Reference(Procedure|MedicationPrescription|DiagnosticOrder|Encounter|Supply)", "The details of the proposed activity represented in a specific resource.", 0, java.lang.Integer.MAX_VALUE, detail)); + childrenList.add(new Property("simple", "", "A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, java.lang.Integer.MAX_VALUE, simple)); + } + + public CareActivity copy() { + CareActivity dst = new CareActivity(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (goal != null) { + dst.goal = new ArrayList(); + for (Reference i : goal) + dst.goal.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.prohibited = prohibited == null ? null : prohibited.copy(); + if (actionResulting != null) { + dst.actionResulting = new ArrayList(); + for (Reference i : actionResulting) + dst.actionResulting.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + dst.detail = detail == null ? null : detail.copy(); + dst.simple = simple == null ? null : simple.copy(); + return dst; + } + + protected CareActivity typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (goal == null || goal.isEmpty()) && (status == null || status.isEmpty()) && (prohibited == null || prohibited.isEmpty()) + && (actionResulting == null || actionResulting.isEmpty()) && (notes == null || notes.isEmpty()) + && (detail == null || detail.isEmpty()) && (simple == null || simple.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CareActivity; + } + + @SearchParamDefinition(name="activitycode", path="CareActivity.simple.code", description="Detail type of activity", type="token" ) + public static final String SP_ACTIVITYCODE = "activitycode"; + @SearchParamDefinition(name="patient", path="CareActivity.patient", description="Who care plan is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="activitydetail", path="CareActivity.detail", description="Activity details defined in specific resource", type="reference" ) + public static final String SP_ACTIVITYDETAIL = "activitydetail"; + @SearchParamDefinition(name="activitydate", path="CareActivity.simple.scheduled[x]", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" ) + public static final String SP_ACTIVITYDATE = "activitydate"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan.java index 07fdc19fe0e..9f24c0a82b0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="CarePlan", profile="http://hl7.org/fhir/Profile/CarePlan") public class CarePlan extends DomainResource { - public enum CarePlanStatus { + public enum CarePlanStatus implements FhirEnum { /** * The plan is in development or awaiting use but is not yet intended to be acted upon. */ @@ -62,7 +62,10 @@ public class CarePlan extends DomainResource { * added to help the parsers */ NULL; - public static CarePlanStatus fromCode(String codeString) throws Exception { + + public static final CarePlanStatusEnumFactory ENUM_FACTORY = new CarePlanStatusEnumFactory(); + + public static CarePlanStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("planned".equals(codeString)) @@ -71,8 +74,9 @@ public class CarePlan extends DomainResource { return ACTIVE; if ("completed".equals(codeString)) return COMPLETED; - throw new Exception("Unknown CarePlanStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PLANNED: return "planned"; @@ -107,8 +111,8 @@ public class CarePlan extends DomainResource { } } - public static class CarePlanStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class CarePlanStatusEnumFactory implements EnumFactory { + public CarePlanStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class CarePlan extends DomainResource { return CarePlanStatus.ACTIVE; if ("completed".equals(codeString)) return CarePlanStatus.COMPLETED; - throw new Exception("Unknown CarePlanStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(CarePlanStatus code) throws IllegalArgumentException { if (code == CarePlanStatus.PLANNED) return "planned"; if (code == CarePlanStatus.ACTIVE) @@ -131,7 +135,7 @@ public class CarePlan extends DomainResource { } } - public enum CarePlanGoalStatus { + public enum CarePlanGoalStatus implements FhirEnum { /** * The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again). */ @@ -152,7 +156,10 @@ public class CarePlan extends DomainResource { * added to help the parsers */ NULL; - public static CarePlanGoalStatus fromCode(String codeString) throws Exception { + + public static final CarePlanGoalStatusEnumFactory ENUM_FACTORY = new CarePlanGoalStatusEnumFactory(); + + public static CarePlanGoalStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("in progress".equals(codeString)) @@ -163,8 +170,9 @@ public class CarePlan extends DomainResource { return SUSTAINING; if ("cancelled".equals(codeString)) return CANCELLED; - throw new Exception("Unknown CarePlanGoalStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CarePlanGoalStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case INPROGRESS: return "in progress"; @@ -203,8 +211,8 @@ public class CarePlan extends DomainResource { } } - public static class CarePlanGoalStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class CarePlanGoalStatusEnumFactory implements EnumFactory { + public CarePlanGoalStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -216,9 +224,9 @@ public class CarePlan extends DomainResource { return CarePlanGoalStatus.SUSTAINING; if ("cancelled".equals(codeString)) return CarePlanGoalStatus.CANCELLED; - throw new Exception("Unknown CarePlanGoalStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CarePlanGoalStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(CarePlanGoalStatus code) throws IllegalArgumentException { if (code == CarePlanGoalStatus.INPROGRESS) return "in progress"; if (code == CarePlanGoalStatus.ACHIEVED) @@ -231,7 +239,7 @@ public class CarePlan extends DomainResource { } } - public enum CarePlanActivityStatus { + public enum CarePlanActivityStatus implements FhirEnum { /** * Activity is planned but no action has yet been taken. */ @@ -260,7 +268,10 @@ public class CarePlan extends DomainResource { * added to help the parsers */ NULL; - public static CarePlanActivityStatus fromCode(String codeString) throws Exception { + + public static final CarePlanActivityStatusEnumFactory ENUM_FACTORY = new CarePlanActivityStatusEnumFactory(); + + public static CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("not started".equals(codeString)) @@ -275,8 +286,9 @@ public class CarePlan extends DomainResource { return COMPLETED; if ("cancelled".equals(codeString)) return CANCELLED; - throw new Exception("Unknown CarePlanActivityStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case NOTSTARTED: return "not started"; @@ -323,8 +335,8 @@ public class CarePlan extends DomainResource { } } - public static class CarePlanActivityStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class CarePlanActivityStatusEnumFactory implements EnumFactory { + public CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -340,9 +352,9 @@ public class CarePlan extends DomainResource { return CarePlanActivityStatus.COMPLETED; if ("cancelled".equals(codeString)) return CarePlanActivityStatus.CANCELLED; - throw new Exception("Unknown CarePlanActivityStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(CarePlanActivityStatus code) throws IllegalArgumentException { if (code == CarePlanActivityStatus.NOTSTARTED) return "not started"; if (code == CarePlanActivityStatus.SCHEDULED) @@ -359,7 +371,7 @@ public class CarePlan extends DomainResource { } } - public enum CarePlanActivityCategory { + public enum CarePlanActivityCategory implements FhirEnum { /** * Plan for the patient to consume food of a specified nature. */ @@ -392,7 +404,10 @@ public class CarePlan extends DomainResource { * added to help the parsers */ NULL; - public static CarePlanActivityCategory fromCode(String codeString) throws Exception { + + public static final CarePlanActivityCategoryEnumFactory ENUM_FACTORY = new CarePlanActivityCategoryEnumFactory(); + + public static CarePlanActivityCategory fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("diet".equals(codeString)) @@ -409,8 +424,9 @@ public class CarePlan extends DomainResource { return SUPPLY; if ("other".equals(codeString)) return OTHER; - throw new Exception("Unknown CarePlanActivityCategory code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DIET: return "diet"; @@ -461,8 +477,8 @@ public class CarePlan extends DomainResource { } } - public static class CarePlanActivityCategoryEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class CarePlanActivityCategoryEnumFactory implements EnumFactory { + public CarePlanActivityCategory fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -480,9 +496,9 @@ public class CarePlan extends DomainResource { return CarePlanActivityCategory.SUPPLY; if ("other".equals(codeString)) return CarePlanActivityCategory.OTHER; - throw new Exception("Unknown CarePlanActivityCategory code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CarePlanActivityCategory code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(CarePlanActivityCategory code) throws IllegalArgumentException { if (code == CarePlanActivityCategory.DIET) return "diet"; if (code == CarePlanActivityCategory.DRUG) @@ -751,7 +767,7 @@ public class CarePlan extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(CarePlanGoalStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -1055,7 +1071,7 @@ public class CarePlan extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(CarePlanActivityStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -1429,7 +1445,7 @@ public class CarePlan extends DomainResource { */ public CarePlanActivitySimpleComponent setCategory(CarePlanActivityCategory value) { if (this.category == null) - this.category = new Enumeration(); + this.category = new Enumeration(CarePlanActivityCategory.ENUM_FACTORY); this.category.setValue(value); return this; } @@ -1969,7 +1985,7 @@ public class CarePlan extends DomainResource { */ public CarePlan setStatus(CarePlanStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(CarePlanStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -2029,14 +2045,14 @@ public class CarePlan extends DomainResource { /** * @return Identifies the most recent date on which the plan has been revised. */ - public DateAndTime getModified() { + public Date getModified() { return this.modified == null ? null : this.modified.getValue(); } /** * @param value Identifies the most recent date on which the plan has been revised. */ - public CarePlan setModified(DateAndTime value) { + public CarePlan setModified(Date value) { if (value == null) this.modified = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan2.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan2.java new file mode 100644 index 00000000000..8511955066e --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CarePlan2.java @@ -0,0 +1,856 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + */ +@ResourceDef(name="CarePlan2", profile="http://hl7.org/fhir/Profile/CarePlan2") +public class CarePlan2 extends DomainResource { + + public enum CarePlan2Status implements FhirEnum { + /** + * The plan is in development or awaiting use but is not yet intended to be acted upon. + */ + PLANNED, + /** + * The plan is intended to be followed and used as part of patient care. + */ + ACTIVE, + /** + * The plan is no longer in use and is not expected to be followed or used in patient care. + */ + COMPLETED, + /** + * added to help the parsers + */ + NULL; + + public static final CarePlan2StatusEnumFactory ENUM_FACTORY = new CarePlan2StatusEnumFactory(); + + public static CarePlan2Status fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return PLANNED; + if ("active".equals(codeString)) + return ACTIVE; + if ("completed".equals(codeString)) + return COMPLETED; + throw new IllegalArgumentException("Unknown CarePlan2Status code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case ACTIVE: return "active"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return ""; + case ACTIVE: return ""; + case COMPLETED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "The plan is in development or awaiting use but is not yet intended to be acted upon."; + case ACTIVE: return "The plan is intended to be followed and used as part of patient care."; + case COMPLETED: return "The plan is no longer in use and is not expected to be followed or used in patient care."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "planned"; + case ACTIVE: return "active"; + case COMPLETED: return "completed"; + default: return "?"; + } + } + } + + public static class CarePlan2StatusEnumFactory implements EnumFactory { + public CarePlan2Status fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return CarePlan2Status.PLANNED; + if ("active".equals(codeString)) + return CarePlan2Status.ACTIVE; + if ("completed".equals(codeString)) + return CarePlan2Status.COMPLETED; + throw new IllegalArgumentException("Unknown CarePlan2Status code '"+codeString+"'"); + } + public String toCode(CarePlan2Status code) throws IllegalArgumentException { + if (code == CarePlan2Status.PLANNED) + return "planned"; + if (code == CarePlan2Status.ACTIVE) + return "active"; + if (code == CarePlan2Status.COMPLETED) + return "completed"; + return "?"; + } + } + + @Block() + public static class CarePlan2ParticipantComponent extends BackboneElement { + /** + * Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc. + */ + @Child(name="role", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Type of involvement", formalDefinition="Indicates specific responsibility of an individual within the care plan. E.g. 'Primary physician', 'Team coordinator', 'Caregiver', etc." ) + protected CodeableConcept role; + + /** + * The specific person or organization who is participating/expected to participate in the care plan. + */ + @Child(name="member", type={Practitioner.class, RelatedPerson.class, Patient.class, Organization.class}, order=2, min=1, max=1) + @Description(shortDefinition="Who is involved", formalDefinition="The specific person or organization who is participating/expected to participate in the care plan." ) + protected Reference member; + + /** + * The actual object that is the target of the reference (The specific person or organization who is participating/expected to participate in the care plan.) + */ + protected Resource memberTarget; + + private static final long serialVersionUID = -466811117L; + + public CarePlan2ParticipantComponent() { + super(); + } + + public CarePlan2ParticipantComponent(Reference member) { + super(); + this.member = member; + } + + /** + * @return {@link #role} (Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc.) + */ + public CodeableConcept getRole() { + if (this.role == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan2ParticipantComponent.role"); + else if (Configuration.doAutoCreate()) + this.role = new CodeableConcept(); + return this.role; + } + + public boolean hasRole() { + return this.role != null && !this.role.isEmpty(); + } + + /** + * @param value {@link #role} (Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc.) + */ + public CarePlan2ParticipantComponent setRole(CodeableConcept value) { + this.role = value; + return this; + } + + /** + * @return {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.) + */ + public Reference getMember() { + if (this.member == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan2ParticipantComponent.member"); + else if (Configuration.doAutoCreate()) + this.member = new Reference(); + return this.member; + } + + public boolean hasMember() { + return this.member != null && !this.member.isEmpty(); + } + + /** + * @param value {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.) + */ + public CarePlan2ParticipantComponent setMember(Reference value) { + this.member = value; + return this; + } + + /** + * @return {@link #member} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.) + */ + public Resource getMemberTarget() { + return this.memberTarget; + } + + /** + * @param value {@link #member} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.) + */ + public CarePlan2ParticipantComponent setMemberTarget(Resource value) { + this.memberTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("role", "CodeableConcept", "Indicates specific responsibility of an individual within the care plan. E.g. 'Primary physician', 'Team coordinator', 'Caregiver', etc.", 0, java.lang.Integer.MAX_VALUE, role)); + childrenList.add(new Property("member", "Reference(Practitioner|RelatedPerson|Patient|Organization)", "The specific person or organization who is participating/expected to participate in the care plan.", 0, java.lang.Integer.MAX_VALUE, member)); + } + + public CarePlan2ParticipantComponent copy() { + CarePlan2ParticipantComponent dst = new CarePlan2ParticipantComponent(); + copyValues(dst); + dst.role = role == null ? null : role.copy(); + dst.member = member == null ? null : member.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (role == null || role.isEmpty()) && (member == null || member.isEmpty()) + ; + } + + } + + /** + * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this plan", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * Identifies the patient/subject whose intended care is described by the plan. + */ + @Child(name="patient", type={Patient.class}, order=0, min=0, max=1) + @Description(shortDefinition="Who care plan is for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.) + */ + protected Patient patientTarget; + + /** + * Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. + */ + @Child(name="status", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="planned | active | completed", formalDefinition="Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record." ) + protected Enumeration status; + + /** + * Indicates when the plan did (or is intended to) come into effect and end. + */ + @Child(name="period", type={Period.class}, order=2, min=0, max=1) + @Description(shortDefinition="Time period plan covers", formalDefinition="Indicates when the plan did (or is intended to) come into effect and end." ) + protected Period period; + + /** + * Identifies the most recent date on which the plan has been revised. + */ + @Child(name="modified", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="When last updated", formalDefinition="Identifies the most recent date on which the plan has been revised." ) + protected DateTimeType modified; + + /** + * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. + */ + @Child(name="concern", type={Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Health issues this plan addresses", formalDefinition="Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan." ) + protected List concern; + /** + * The actual objects that are the target of the reference (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + protected List concernTarget; + + + /** + * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. + */ + @Child(name="participant", type={}, order=5, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Who's involved in plan?", formalDefinition="Identifies all people and organizations who are expected to be involved in the care envisioned by this plan." ) + protected List participant; + + /** + * General notes about the care plan not covered elsewhere. + */ + @Child(name="notes", type={StringType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Comments about the plan", formalDefinition="General notes about the care plan not covered elsewhere." ) + protected StringType notes; + + /** + * Describes the intended objective(s) of carrying out the Care Plan. + */ + @Child(name="goal", type={Goal.class}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="CarePlan Goal", formalDefinition="Describes the intended objective(s) of carrying out the Care Plan." ) + protected List goal; + /** + * The actual objects that are the target of the reference (Describes the intended objective(s) of carrying out the Care Plan.) + */ + protected List goalTarget; + + + /** + * Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. + */ + @Child(name="activity", type={CareActivity.class}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="CarePlan Activity", formalDefinition="Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc." ) + protected List activity; + /** + * The actual objects that are the target of the reference (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.) + */ + protected List activityTarget; + + + private static final long serialVersionUID = -1325874459L; + + public CarePlan2() { + super(); + } + + public CarePlan2(Enumeration status) { + super(); + this.status = status; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan2.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public CarePlan2 setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan2.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public CarePlan2 setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan2.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public CarePlan2 setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. + */ + public CarePlan2Status getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. + */ + public CarePlan2 setStatus(CarePlan2Status value) { + if (this.status == null) + this.status = new Enumeration(CarePlan2Status.ENUM_FACTORY); + this.status.setValue(value); + return this; + } + + /** + * @return {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan2.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.) + */ + public CarePlan2 setPeriod(Period value) { + this.period = value; + return this; + } + + /** + * @return {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value + */ + public DateTimeType getModifiedElement() { + if (this.modified == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan2.modified"); + else if (Configuration.doAutoCreate()) + this.modified = new DateTimeType(); + return this.modified; + } + + public boolean hasModifiedElement() { + return this.modified != null && !this.modified.isEmpty(); + } + + public boolean hasModified() { + return this.modified != null && !this.modified.isEmpty(); + } + + /** + * @param value {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value + */ + public CarePlan2 setModifiedElement(DateTimeType value) { + this.modified = value; + return this; + } + + /** + * @return Identifies the most recent date on which the plan has been revised. + */ + public Date getModified() { + return this.modified == null ? null : this.modified.getValue(); + } + + /** + * @param value Identifies the most recent date on which the plan has been revised. + */ + public CarePlan2 setModified(Date value) { + if (value == null) + this.modified = null; + else { + if (this.modified == null) + this.modified = new DateTimeType(); + this.modified.setValue(value); + } + return this; + } + + /** + * @return {@link #concern} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + public List getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + return this.concern; + } + + public boolean hasConcern() { + if (this.concern == null) + return false; + for (Reference item : this.concern) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concern} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + // syntactic sugar + public Reference addConcern() { //3 + Reference t = new Reference(); + if (this.concern == null) + this.concern = new ArrayList(); + this.concern.add(t); + return t; + } + + /** + * @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + public List getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + return this.concernTarget; + } + + // syntactic sugar + /** + * @return {@link #concern} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) + */ + public Condition addConcernTarget() { + Condition r = new Condition(); + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + this.concernTarget.add(r); + return r; + } + + /** + * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.) + */ + public List getParticipant() { + if (this.participant == null) + this.participant = new ArrayList(); + return this.participant; + } + + public boolean hasParticipant() { + if (this.participant == null) + return false; + for (CarePlan2ParticipantComponent item : this.participant) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.) + */ + // syntactic sugar + public CarePlan2ParticipantComponent addParticipant() { //3 + CarePlan2ParticipantComponent t = new CarePlan2ParticipantComponent(); + if (this.participant == null) + this.participant = new ArrayList(); + this.participant.add(t); + return t; + } + + /** + * @return {@link #notes} (General notes about the care plan not covered elsewhere.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CarePlan2.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (General notes about the care plan not covered elsewhere.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public CarePlan2 setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return General notes about the care plan not covered elsewhere. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value General notes about the care plan not covered elsewhere. + */ + public CarePlan2 setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + /** + * @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.) + */ + public List getGoal() { + if (this.goal == null) + this.goal = new ArrayList(); + return this.goal; + } + + public boolean hasGoal() { + if (this.goal == null) + return false; + for (Reference item : this.goal) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #goal} (Describes the intended objective(s) of carrying out the Care Plan.) + */ + // syntactic sugar + public Reference addGoal() { //3 + Reference t = new Reference(); + if (this.goal == null) + this.goal = new ArrayList(); + this.goal.add(t); + return t; + } + + /** + * @return {@link #goal} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the Care Plan.) + */ + public List getGoalTarget() { + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + return this.goalTarget; + } + + // syntactic sugar + /** + * @return {@link #goal} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the Care Plan.) + */ + public Goal addGoalTarget() { + Goal r = new Goal(); + if (this.goalTarget == null) + this.goalTarget = new ArrayList(); + this.goalTarget.add(r); + return r; + } + + /** + * @return {@link #activity} (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.) + */ + public List getActivity() { + if (this.activity == null) + this.activity = new ArrayList(); + return this.activity; + } + + public boolean hasActivity() { + if (this.activity == null) + return false; + for (Reference item : this.activity) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #activity} (Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.) + */ + // syntactic sugar + public Reference addActivity() { //3 + Reference t = new Reference(); + if (this.activity == null) + this.activity = new ArrayList(); + this.activity.add(t); + return t; + } + + /** + * @return {@link #activity} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.) + */ + public List getActivityTarget() { + if (this.activityTarget == null) + this.activityTarget = new ArrayList(); + return this.activityTarget; + } + + // syntactic sugar + /** + * @return {@link #activity} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.) + */ + public CareActivity addActivityTarget() { + CareActivity r = new CareActivity(); + if (this.activityTarget == null) + this.activityTarget = new ArrayList(); + this.activityTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("status", "code", "Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("period", "Period", "Indicates when the plan did (or is intended to) come into effect and end.", 0, java.lang.Integer.MAX_VALUE, period)); + childrenList.add(new Property("modified", "dateTime", "Identifies the most recent date on which the plan has been revised.", 0, java.lang.Integer.MAX_VALUE, modified)); + childrenList.add(new Property("concern", "Reference(Condition)", "Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.", 0, java.lang.Integer.MAX_VALUE, concern)); + childrenList.add(new Property("participant", "", "Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.", 0, java.lang.Integer.MAX_VALUE, participant)); + childrenList.add(new Property("notes", "string", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("goal", "Reference(Goal)", "Describes the intended objective(s) of carrying out the Care Plan.", 0, java.lang.Integer.MAX_VALUE, goal)); + childrenList.add(new Property("activity", "Reference(CareActivity)", "Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.", 0, java.lang.Integer.MAX_VALUE, activity)); + } + + public CarePlan2 copy() { + CarePlan2 dst = new CarePlan2(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.status = status == null ? null : status.copy(); + dst.period = period == null ? null : period.copy(); + dst.modified = modified == null ? null : modified.copy(); + if (concern != null) { + dst.concern = new ArrayList(); + for (Reference i : concern) + dst.concern.add(i.copy()); + }; + if (participant != null) { + dst.participant = new ArrayList(); + for (CarePlan2ParticipantComponent i : participant) + dst.participant.add(i.copy()); + }; + dst.notes = notes == null ? null : notes.copy(); + if (goal != null) { + dst.goal = new ArrayList(); + for (Reference i : goal) + dst.goal.add(i.copy()); + }; + if (activity != null) { + dst.activity = new ArrayList(); + for (Reference i : activity) + dst.activity.add(i.copy()); + }; + return dst; + } + + protected CarePlan2 typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (modified == null || modified.isEmpty()) + && (concern == null || concern.isEmpty()) && (participant == null || participant.isEmpty()) + && (notes == null || notes.isEmpty()) && (goal == null || goal.isEmpty()) && (activity == null || activity.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.CarePlan2; + } + + @SearchParamDefinition(name="patient", path="CarePlan2.patient", description="Who care plan is for", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="condition", path="CarePlan2.concern", description="Health issues this plan addresses", type="reference" ) + public static final String SP_CONDITION = "condition"; + @SearchParamDefinition(name="participant", path="CarePlan2.participant.member", description="Who is involved", type="reference" ) + public static final String SP_PARTICIPANT = "participant"; + @SearchParamDefinition(name="date", path="CarePlan2.period", description="Time period plan covers", type="date" ) + public static final String SP_DATE = "date"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java index 29ca9c7449b..9cdb915bef3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClaimResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -46,7 +46,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/Profile/ClaimResponse") public class ClaimResponse extends DomainResource { - public enum RSLink { + public enum RSLink implements FhirEnum { /** * The processing completed without errors. */ @@ -59,15 +59,19 @@ public class ClaimResponse extends DomainResource { * added to help the parsers */ NULL; - public static RSLink fromCode(String codeString) throws Exception { + + public static final RSLinkEnumFactory ENUM_FACTORY = new RSLinkEnumFactory(); + + public static RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("complete".equals(codeString)) return COMPLETE; if ("error".equals(codeString)) return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case COMPLETE: return "complete"; @@ -98,8 +102,8 @@ public class ClaimResponse extends DomainResource { } } - public static class RSLinkEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -107,9 +111,9 @@ public class ClaimResponse extends DomainResource { return RSLink.COMPLETE; if ("error".equals(codeString)) return RSLink.ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(RSLink code) throws IllegalArgumentException { if (code == RSLink.COMPLETE) return "complete"; if (code == RSLink.ERROR) @@ -2328,9 +2332,9 @@ public class ClaimResponse extends DomainResource { /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name="date", type={DateType.class}, order=3, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=3, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who produced this adjudicated response. @@ -2487,7 +2491,7 @@ public class ClaimResponse extends DomainResource { @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) protected List note; - private static final long serialVersionUID = 2102880382L; + private static final long serialVersionUID = -1199888229L; public ClaimResponse() { super(); @@ -2616,50 +2620,50 @@ public class ClaimResponse extends DomainResource { } /** - * @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.date"); + throw new Error("Attempt to auto-create ClaimResponse.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public ClaimResponse setDateElement(DateType value) { - this.date = value; + public ClaimResponse setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when the enclosed suite of services were performed or completed. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when the enclosed suite of services were performed or completed. */ - public ClaimResponse setDate(DateAndTime value) { + public ClaimResponse setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -2839,7 +2843,7 @@ public class ClaimResponse extends DomainResource { this.outcome = null; else { if (this.outcome == null) - this.outcome = new Enumeration(); + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); this.outcome.setValue(value); } return this; @@ -3159,14 +3163,14 @@ public class ClaimResponse extends DomainResource { /** * @return Estimated payment data. */ - public DateAndTime getPaymentDate() { + public Date getPaymentDate() { return this.paymentDate == null ? null : this.paymentDate.getValue(); } /** * @param value Estimated payment data. */ - public ClaimResponse setPaymentDate(DateAndTime value) { + public ClaimResponse setPaymentDate(Date value) { if (value == null) this.paymentDate = null; else { @@ -3309,7 +3313,7 @@ public class ClaimResponse extends DomainResource { childrenList.add(new Property("request", "Reference(OralHealthClaim)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); @@ -3343,7 +3347,7 @@ public class ClaimResponse extends DomainResource { dst.request = request == null ? null : request.copy(); dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.organization = organization == null ? null : organization.copy(); dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); @@ -3390,11 +3394,11 @@ public class ClaimResponse extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty()) - && (requestOrganization == null || requestOrganization.isEmpty()) && (outcome == null || outcome.isEmpty()) - && (disposition == null || disposition.isEmpty()) && (payeeType == null || payeeType.isEmpty()) - && (item == null || item.isEmpty()) && (additem == null || additem.isEmpty()) && (error == null || error.isEmpty()) - && (totalCost == null || totalCost.isEmpty()) && (unallocDeductable == null || unallocDeductable.isEmpty()) + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) + && (payeeType == null || payeeType.isEmpty()) && (item == null || item.isEmpty()) && (additem == null || additem.isEmpty()) + && (error == null || error.isEmpty()) && (totalCost == null || totalCost.isEmpty()) && (unallocDeductable == null || unallocDeductable.isEmpty()) && (totalBenefit == null || totalBenefit.isEmpty()) && (paymentAdjustment == null || paymentAdjustment.isEmpty()) && (paymentAdjustmentReason == null || paymentAdjustmentReason.isEmpty()) && (paymentDate == null || paymentDate.isEmpty()) && (paymentAmount == null || paymentAmount.isEmpty()) && (paymentRef == null || paymentRef.isEmpty()) diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClinicalAssessment.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClinicalAssessment.java new file mode 100644 index 00000000000..22b6f9efc1f --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ClinicalAssessment.java @@ -0,0 +1,1400 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. + */ +@ResourceDef(name="ClinicalAssessment", profile="http://hl7.org/fhir/Profile/ClinicalAssessment") +public class ClinicalAssessment extends DomainResource { + + @Block() + public static class ClinicalAssessmentInvestigationsComponent extends BackboneElement { + /** + * A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used. + */ + @Child(name="code", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="A name/code for the set", formalDefinition="A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used." ) + protected CodeableConcept code; + + /** + * A record of a specific investigation that was undertaken. + */ + @Child(name="item", type={Observation.class, QuestionnaireAnswers.class, FamilyHistory.class, DiagnosticReport.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Record of a specific investigation", formalDefinition="A record of a specific investigation that was undertaken." ) + protected List item; + /** + * The actual objects that are the target of the reference (A record of a specific investigation that was undertaken.) + */ + protected List itemTarget; + + + private static final long serialVersionUID = -301363326L; + + public ClinicalAssessmentInvestigationsComponent() { + super(); + } + + public ClinicalAssessmentInvestigationsComponent(CodeableConcept code) { + super(); + this.code = code; + } + + /** + * @return {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) + */ + public CodeableConcept getCode() { + if (this.code == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentInvestigationsComponent.code"); + else if (Configuration.doAutoCreate()) + this.code = new CodeableConcept(); + return this.code; + } + + public boolean hasCode() { + return this.code != null && !this.code.isEmpty(); + } + + /** + * @param value {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) + */ + public ClinicalAssessmentInvestigationsComponent setCode(CodeableConcept value) { + this.code = value; + return this; + } + + /** + * @return {@link #item} (A record of a specific investigation that was undertaken.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (Reference item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (A record of a specific investigation that was undertaken.) + */ + // syntactic sugar + public Reference addItem() { //3 + Reference t = new Reference(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #item} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A record of a specific investigation that was undertaken.) + */ + public List getItemTarget() { + if (this.itemTarget == null) + this.itemTarget = new ArrayList(); + return this.itemTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("code", "CodeableConcept", "A name/code for the group ('set') of investigations. Typically, this will be something like 'signs', 'symptoms', 'clinical', 'diagnostic', but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("item", "Reference(Observation|QuestionnaireAnswers|FamilyHistory|DiagnosticReport)", "A record of a specific investigation that was undertaken.", 0, java.lang.Integer.MAX_VALUE, item)); + } + + public ClinicalAssessmentInvestigationsComponent copy() { + ClinicalAssessmentInvestigationsComponent dst = new ClinicalAssessmentInvestigationsComponent(); + copyValues(dst); + dst.code = code == null ? null : code.copy(); + if (item != null) { + dst.item = new ArrayList(); + for (Reference i : item) + dst.item.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (code == null || code.isEmpty()) && (item == null || item.isEmpty()) + ; + } + + } + + @Block() + public static class ClinicalAssessmentDiagnosisComponent extends BackboneElement { + /** + * Specific text of code for diagnosis. + */ + @Child(name="item", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Specific text or code for diagnosis", formalDefinition="Specific text of code for diagnosis." ) + protected CodeableConcept item; + + /** + * Which investigations support diagnosis. + */ + @Child(name="cause", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Which investigations support diagnosis", formalDefinition="Which investigations support diagnosis." ) + protected StringType cause; + + private static final long serialVersionUID = -888590978L; + + public ClinicalAssessmentDiagnosisComponent() { + super(); + } + + public ClinicalAssessmentDiagnosisComponent(CodeableConcept item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Specific text of code for diagnosis.) + */ + public CodeableConcept getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentDiagnosisComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new CodeableConcept(); + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Specific text of code for diagnosis.) + */ + public ClinicalAssessmentDiagnosisComponent setItem(CodeableConcept value) { + this.item = value; + return this; + } + + /** + * @return {@link #cause} (Which investigations support diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value + */ + public StringType getCauseElement() { + if (this.cause == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentDiagnosisComponent.cause"); + else if (Configuration.doAutoCreate()) + this.cause = new StringType(); + return this.cause; + } + + public boolean hasCauseElement() { + return this.cause != null && !this.cause.isEmpty(); + } + + public boolean hasCause() { + return this.cause != null && !this.cause.isEmpty(); + } + + /** + * @param value {@link #cause} (Which investigations support diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value + */ + public ClinicalAssessmentDiagnosisComponent setCauseElement(StringType value) { + this.cause = value; + return this; + } + + /** + * @return Which investigations support diagnosis. + */ + public String getCause() { + return this.cause == null ? null : this.cause.getValue(); + } + + /** + * @param value Which investigations support diagnosis. + */ + public ClinicalAssessmentDiagnosisComponent setCause(String value) { + if (Utilities.noString(value)) + this.cause = null; + else { + if (this.cause == null) + this.cause = new StringType(); + this.cause.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("cause", "string", "Which investigations support diagnosis.", 0, java.lang.Integer.MAX_VALUE, cause)); + } + + public ClinicalAssessmentDiagnosisComponent copy() { + ClinicalAssessmentDiagnosisComponent dst = new ClinicalAssessmentDiagnosisComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.cause = cause == null ? null : cause.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (cause == null || cause.isEmpty()) + ; + } + + } + + @Block() + public static class ClinicalAssessmentRuledOutComponent extends BackboneElement { + /** + * Specific text of code for diagnosis. + */ + @Child(name="item", type={CodeableConcept.class}, order=1, min=1, max=1) + @Description(shortDefinition="Specific text of code for diagnosis", formalDefinition="Specific text of code for diagnosis." ) + protected CodeableConcept item; + + /** + * Grounds for elimination. + */ + @Child(name="reason", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Grounds for elimination", formalDefinition="Grounds for elimination." ) + protected StringType reason; + + private static final long serialVersionUID = -1001661243L; + + public ClinicalAssessmentRuledOutComponent() { + super(); + } + + public ClinicalAssessmentRuledOutComponent(CodeableConcept item) { + super(); + this.item = item; + } + + /** + * @return {@link #item} (Specific text of code for diagnosis.) + */ + public CodeableConcept getItem() { + if (this.item == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentRuledOutComponent.item"); + else if (Configuration.doAutoCreate()) + this.item = new CodeableConcept(); + return this.item; + } + + public boolean hasItem() { + return this.item != null && !this.item.isEmpty(); + } + + /** + * @param value {@link #item} (Specific text of code for diagnosis.) + */ + public ClinicalAssessmentRuledOutComponent setItem(CodeableConcept value) { + this.item = value; + return this; + } + + /** + * @return {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public StringType getReasonElement() { + if (this.reason == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessmentRuledOutComponent.reason"); + else if (Configuration.doAutoCreate()) + this.reason = new StringType(); + return this.reason; + } + + public boolean hasReasonElement() { + return this.reason != null && !this.reason.isEmpty(); + } + + public boolean hasReason() { + return this.reason != null && !this.reason.isEmpty(); + } + + /** + * @param value {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value + */ + public ClinicalAssessmentRuledOutComponent setReasonElement(StringType value) { + this.reason = value; + return this; + } + + /** + * @return Grounds for elimination. + */ + public String getReason() { + return this.reason == null ? null : this.reason.getValue(); + } + + /** + * @param value Grounds for elimination. + */ + public ClinicalAssessmentRuledOutComponent setReason(String value) { + if (Utilities.noString(value)) + this.reason = null; + else { + if (this.reason == null) + this.reason = new StringType(); + this.reason.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("reason", "string", "Grounds for elimination.", 0, java.lang.Integer.MAX_VALUE, reason)); + } + + public ClinicalAssessmentRuledOutComponent copy() { + ClinicalAssessmentRuledOutComponent dst = new ClinicalAssessmentRuledOutComponent(); + copyValues(dst); + dst.item = item == null ? null : item.copy(); + dst.reason = reason == null ? null : reason.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (item == null || item.isEmpty()) && (reason == null || reason.isEmpty()) + ; + } + + } + + /** + * The patient being asssesed. + */ + @Child(name="patient", type={Patient.class}, order=-1, min=1, max=1) + @Description(shortDefinition="The patient being asssesed", formalDefinition="The patient being asssesed." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (The patient being asssesed.) + */ + protected Patient patientTarget; + + /** + * The clinicial performing the assessment. + */ + @Child(name="assessor", type={Practitioner.class}, order=0, min=1, max=1) + @Description(shortDefinition="The clinicial performing the assessment", formalDefinition="The clinicial performing the assessment." ) + protected Reference assessor; + + /** + * The actual object that is the target of the reference (The clinicial performing the assessment.) + */ + protected Practitioner assessorTarget; + + /** + * The point in time at which the assessment was concluded (not when it was recorded). + */ + @Child(name="date", type={DateTimeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="When the assessment occurred", formalDefinition="The point in time at which the assessment was concluded (not when it was recorded)." ) + protected DateTimeType date; + + /** + * A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + */ + @Child(name="description", type={StringType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Why/how the assessment was performed", formalDefinition="A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it." ) + protected StringType description; + + /** + * A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes. + */ + @Child(name="previous", type={ClinicalAssessment.class}, order=3, min=0, max=1) + @Description(shortDefinition="Reference to last assessment", formalDefinition="A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes." ) + protected Reference previous; + + /** + * The actual object that is the target of the reference (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + protected ClinicalAssessment previousTarget; + + /** + * This a list of the general problems/conditions for a patient. + */ + @Child(name="problem", type={Condition.class, AllergyIntolerance.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="General assessment of patient state", formalDefinition="This a list of the general problems/conditions for a patient." ) + protected List problem; + /** + * The actual objects that are the target of the reference (This a list of the general problems/conditions for a patient.) + */ + protected List problemTarget; + + + /** + * A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment. + */ + @Child(name="careplan", type={CarePlan.class}, order=5, min=0, max=1) + @Description(shortDefinition="A specific careplan that prompted this assessment", formalDefinition="A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment." ) + protected Reference careplan; + + /** + * The actual object that is the target of the reference (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + protected CarePlan careplanTarget; + + /** + * A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment. + */ + @Child(name="referral", type={ReferralRequest.class}, order=6, min=0, max=1) + @Description(shortDefinition="A specific referral that lead to this assessment", formalDefinition="A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + protected ReferralRequest referralTarget; + + /** + * One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. + */ + @Child(name="investigations", type={}, order=7, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="One or more sets of investigations (signs, symptions, etc)", formalDefinition="One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes." ) + protected List investigations; + + /** + * Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + */ + @Child(name="protocol", type={UriType.class}, order=8, min=0, max=1) + @Description(shortDefinition="Clinical Protocol followed", formalDefinition="Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis." ) + protected UriType protocol; + + /** + * A text summary of the investigations and the diagnosis. + */ + @Child(name="summary", type={StringType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Summary of the assessment", formalDefinition="A text summary of the investigations and the diagnosis." ) + protected StringType summary; + + /** + * An specific diagnosis that was considered likely or relevant to ongoing treatment. + */ + @Child(name="diagnosis", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Possible or likely diagnosis", formalDefinition="An specific diagnosis that was considered likely or relevant to ongoing treatment." ) + protected List diagnosis; + + /** + * Diagnoses/conditions resolved since the last assessment. + */ + @Child(name="resolved", type={CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosies/conditions resolved since previous assessment", formalDefinition="Diagnoses/conditions resolved since the last assessment." ) + protected List resolved; + + /** + * Diagnosis considered not possible. + */ + @Child(name="ruledOut", type={}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis considered not possible", formalDefinition="Diagnosis considered not possible." ) + protected List ruledOut; + + /** + * Estimate of likely outcome. + */ + @Child(name="prognosis", type={StringType.class}, order=13, min=0, max=1) + @Description(shortDefinition="Estimate of likely outcome", formalDefinition="Estimate of likely outcome." ) + protected StringType prognosis; + + /** + * Plan of action after assessment. + */ + @Child(name="plan", type={CarePlan.class}, order=14, min=0, max=1) + @Description(shortDefinition="Plan of action after assessment", formalDefinition="Plan of action after assessment." ) + protected Reference plan; + + /** + * The actual object that is the target of the reference (Plan of action after assessment.) + */ + protected CarePlan planTarget; + + /** + * Actions taken during assessment. + */ + @Child(name="action", type={ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationPrescription.class, DiagnosticOrder.class, NutritionOrder.class, Supply.class, Appointment.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Actions taken during assessment", formalDefinition="Actions taken during assessment." ) + protected List action; + /** + * The actual objects that are the target of the reference (Actions taken during assessment.) + */ + protected List actionTarget; + + + private static final long serialVersionUID = 1041335013L; + + public ClinicalAssessment() { + super(); + } + + public ClinicalAssessment(Reference patient, Reference assessor, DateTimeType date) { + super(); + this.patient = patient; + this.assessor = assessor; + this.date = date; + } + + /** + * @return {@link #patient} (The patient being asssesed.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (The patient being asssesed.) + */ + public ClinicalAssessment setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient being asssesed.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient being asssesed.) + */ + public ClinicalAssessment setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #assessor} (The clinicial performing the assessment.) + */ + public Reference getAssessor() { + if (this.assessor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.assessor"); + else if (Configuration.doAutoCreate()) + this.assessor = new Reference(); + return this.assessor; + } + + public boolean hasAssessor() { + return this.assessor != null && !this.assessor.isEmpty(); + } + + /** + * @param value {@link #assessor} (The clinicial performing the assessment.) + */ + public ClinicalAssessment setAssessor(Reference value) { + this.assessor = value; + return this; + } + + /** + * @return {@link #assessor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The clinicial performing the assessment.) + */ + public Practitioner getAssessorTarget() { + if (this.assessorTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.assessor"); + else if (Configuration.doAutoCreate()) + this.assessorTarget = new Practitioner(); + return this.assessorTarget; + } + + /** + * @param value {@link #assessor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The clinicial performing the assessment.) + */ + public ClinicalAssessment setAssessorTarget(Practitioner value) { + this.assessorTarget = value; + return this; + } + + /** + * @return {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public DateTimeType getDateElement() { + if (this.date == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.date"); + else if (Configuration.doAutoCreate()) + this.date = new DateTimeType(); + return this.date; + } + + public boolean hasDateElement() { + return this.date != null && !this.date.isEmpty(); + } + + public boolean hasDate() { + return this.date != null && !this.date.isEmpty(); + } + + /** + * @param value {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + */ + public ClinicalAssessment setDateElement(DateTimeType value) { + this.date = value; + return this; + } + + /** + * @return The point in time at which the assessment was concluded (not when it was recorded). + */ + public Date getDate() { + return this.date == null ? null : this.date.getValue(); + } + + /** + * @param value The point in time at which the assessment was concluded (not when it was recorded). + */ + public ClinicalAssessment setDate(Date value) { + if (this.date == null) + this.date = new DateTimeType(); + this.date.setValue(value); + return this; + } + + /** + * @return {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public ClinicalAssessment setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + */ + public ClinicalAssessment setDescription(String value) { + if (Utilities.noString(value)) + this.description = null; + else { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + } + return this; + } + + /** + * @return {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public Reference getPrevious() { + if (this.previous == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.previous"); + else if (Configuration.doAutoCreate()) + this.previous = new Reference(); + return this.previous; + } + + public boolean hasPrevious() { + return this.previous != null && !this.previous.isEmpty(); + } + + /** + * @param value {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public ClinicalAssessment setPrevious(Reference value) { + this.previous = value; + return this; + } + + /** + * @return {@link #previous} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public ClinicalAssessment getPreviousTarget() { + if (this.previousTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.previous"); + else if (Configuration.doAutoCreate()) + this.previousTarget = new ClinicalAssessment(); + return this.previousTarget; + } + + /** + * @param value {@link #previous} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) + */ + public ClinicalAssessment setPreviousTarget(ClinicalAssessment value) { + this.previousTarget = value; + return this; + } + + /** + * @return {@link #problem} (This a list of the general problems/conditions for a patient.) + */ + public List getProblem() { + if (this.problem == null) + this.problem = new ArrayList(); + return this.problem; + } + + public boolean hasProblem() { + if (this.problem == null) + return false; + for (Reference item : this.problem) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #problem} (This a list of the general problems/conditions for a patient.) + */ + // syntactic sugar + public Reference addProblem() { //3 + Reference t = new Reference(); + if (this.problem == null) + this.problem = new ArrayList(); + this.problem.add(t); + return t; + } + + /** + * @return {@link #problem} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. This a list of the general problems/conditions for a patient.) + */ + public List getProblemTarget() { + if (this.problemTarget == null) + this.problemTarget = new ArrayList(); + return this.problemTarget; + } + + /** + * @return {@link #careplan} (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + public Reference getCareplan() { + if (this.careplan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.careplan"); + else if (Configuration.doAutoCreate()) + this.careplan = new Reference(); + return this.careplan; + } + + public boolean hasCareplan() { + return this.careplan != null && !this.careplan.isEmpty(); + } + + /** + * @param value {@link #careplan} (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + public ClinicalAssessment setCareplan(Reference value) { + this.careplan = value; + return this; + } + + /** + * @return {@link #careplan} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + public CarePlan getCareplanTarget() { + if (this.careplanTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.careplan"); + else if (Configuration.doAutoCreate()) + this.careplanTarget = new CarePlan(); + return this.careplanTarget; + } + + /** + * @param value {@link #careplan} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.) + */ + public ClinicalAssessment setCareplanTarget(CarePlan value) { + this.careplanTarget = value; + return this; + } + + /** + * @return {@link #referral} (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + public ClinicalAssessment setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.) + */ + public ClinicalAssessment setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) + */ + public List getInvestigations() { + if (this.investigations == null) + this.investigations = new ArrayList(); + return this.investigations; + } + + public boolean hasInvestigations() { + if (this.investigations == null) + return false; + for (ClinicalAssessmentInvestigationsComponent item : this.investigations) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) + */ + // syntactic sugar + public ClinicalAssessmentInvestigationsComponent addInvestigations() { //3 + ClinicalAssessmentInvestigationsComponent t = new ClinicalAssessmentInvestigationsComponent(); + if (this.investigations == null) + this.investigations = new ArrayList(); + this.investigations.add(t); + return t; + } + + /** + * @return {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value + */ + public UriType getProtocolElement() { + if (this.protocol == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.protocol"); + else if (Configuration.doAutoCreate()) + this.protocol = new UriType(); + return this.protocol; + } + + public boolean hasProtocolElement() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + public boolean hasProtocol() { + return this.protocol != null && !this.protocol.isEmpty(); + } + + /** + * @param value {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value + */ + public ClinicalAssessment setProtocolElement(UriType value) { + this.protocol = value; + return this; + } + + /** + * @return Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + */ + public String getProtocol() { + return this.protocol == null ? null : this.protocol.getValue(); + } + + /** + * @param value Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + */ + public ClinicalAssessment setProtocol(String value) { + if (Utilities.noString(value)) + this.protocol = null; + else { + if (this.protocol == null) + this.protocol = new UriType(); + this.protocol.setValue(value); + } + return this; + } + + /** + * @return {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value + */ + public StringType getSummaryElement() { + if (this.summary == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.summary"); + else if (Configuration.doAutoCreate()) + this.summary = new StringType(); + return this.summary; + } + + public boolean hasSummaryElement() { + return this.summary != null && !this.summary.isEmpty(); + } + + public boolean hasSummary() { + return this.summary != null && !this.summary.isEmpty(); + } + + /** + * @param value {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value + */ + public ClinicalAssessment setSummaryElement(StringType value) { + this.summary = value; + return this; + } + + /** + * @return A text summary of the investigations and the diagnosis. + */ + public String getSummary() { + return this.summary == null ? null : this.summary.getValue(); + } + + /** + * @param value A text summary of the investigations and the diagnosis. + */ + public ClinicalAssessment setSummary(String value) { + if (Utilities.noString(value)) + this.summary = null; + else { + if (this.summary == null) + this.summary = new StringType(); + this.summary.setValue(value); + } + return this; + } + + /** + * @return {@link #diagnosis} (An specific diagnosis that was considered likely or relevant to ongoing treatment.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (ClinicalAssessmentDiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (An specific diagnosis that was considered likely or relevant to ongoing treatment.) + */ + // syntactic sugar + public ClinicalAssessmentDiagnosisComponent addDiagnosis() { //3 + ClinicalAssessmentDiagnosisComponent t = new ClinicalAssessmentDiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) + */ + public List getResolved() { + if (this.resolved == null) + this.resolved = new ArrayList(); + return this.resolved; + } + + public boolean hasResolved() { + if (this.resolved == null) + return false; + for (CodeableConcept item : this.resolved) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) + */ + // syntactic sugar + public CodeableConcept addResolved() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.resolved == null) + this.resolved = new ArrayList(); + this.resolved.add(t); + return t; + } + + /** + * @return {@link #ruledOut} (Diagnosis considered not possible.) + */ + public List getRuledOut() { + if (this.ruledOut == null) + this.ruledOut = new ArrayList(); + return this.ruledOut; + } + + public boolean hasRuledOut() { + if (this.ruledOut == null) + return false; + for (ClinicalAssessmentRuledOutComponent item : this.ruledOut) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #ruledOut} (Diagnosis considered not possible.) + */ + // syntactic sugar + public ClinicalAssessmentRuledOutComponent addRuledOut() { //3 + ClinicalAssessmentRuledOutComponent t = new ClinicalAssessmentRuledOutComponent(); + if (this.ruledOut == null) + this.ruledOut = new ArrayList(); + this.ruledOut.add(t); + return t; + } + + /** + * @return {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value + */ + public StringType getPrognosisElement() { + if (this.prognosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.prognosis"); + else if (Configuration.doAutoCreate()) + this.prognosis = new StringType(); + return this.prognosis; + } + + public boolean hasPrognosisElement() { + return this.prognosis != null && !this.prognosis.isEmpty(); + } + + public boolean hasPrognosis() { + return this.prognosis != null && !this.prognosis.isEmpty(); + } + + /** + * @param value {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value + */ + public ClinicalAssessment setPrognosisElement(StringType value) { + this.prognosis = value; + return this; + } + + /** + * @return Estimate of likely outcome. + */ + public String getPrognosis() { + return this.prognosis == null ? null : this.prognosis.getValue(); + } + + /** + * @param value Estimate of likely outcome. + */ + public ClinicalAssessment setPrognosis(String value) { + if (Utilities.noString(value)) + this.prognosis = null; + else { + if (this.prognosis == null) + this.prognosis = new StringType(); + this.prognosis.setValue(value); + } + return this; + } + + /** + * @return {@link #plan} (Plan of action after assessment.) + */ + public Reference getPlan() { + if (this.plan == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.plan"); + else if (Configuration.doAutoCreate()) + this.plan = new Reference(); + return this.plan; + } + + public boolean hasPlan() { + return this.plan != null && !this.plan.isEmpty(); + } + + /** + * @param value {@link #plan} (Plan of action after assessment.) + */ + public ClinicalAssessment setPlan(Reference value) { + this.plan = value; + return this; + } + + /** + * @return {@link #plan} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Plan of action after assessment.) + */ + public CarePlan getPlanTarget() { + if (this.planTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ClinicalAssessment.plan"); + else if (Configuration.doAutoCreate()) + this.planTarget = new CarePlan(); + return this.planTarget; + } + + /** + * @param value {@link #plan} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Plan of action after assessment.) + */ + public ClinicalAssessment setPlanTarget(CarePlan value) { + this.planTarget = value; + return this; + } + + /** + * @return {@link #action} (Actions taken during assessment.) + */ + public List getAction() { + if (this.action == null) + this.action = new ArrayList(); + return this.action; + } + + public boolean hasAction() { + if (this.action == null) + return false; + for (Reference item : this.action) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #action} (Actions taken during assessment.) + */ + // syntactic sugar + public Reference addAction() { //3 + Reference t = new Reference(); + if (this.action == null) + this.action = new ArrayList(); + this.action.add(t); + return t; + } + + /** + * @return {@link #action} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Actions taken during assessment.) + */ + public List getActionTarget() { + if (this.actionTarget == null) + this.actionTarget = new ArrayList(); + return this.actionTarget; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("patient", "Reference(Patient)", "The patient being asssesed.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("assessor", "Reference(Practitioner)", "The clinicial performing the assessment.", 0, java.lang.Integer.MAX_VALUE, assessor)); + childrenList.add(new Property("date", "dateTime", "The point in time at which the assessment was concluded (not when it was recorded).", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("description", "string", "A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("previous", "Reference(ClinicalAssessment)", "A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.", 0, java.lang.Integer.MAX_VALUE, previous)); + childrenList.add(new Property("problem", "Reference(Condition|AllergyIntolerance)", "This a list of the general problems/conditions for a patient.", 0, java.lang.Integer.MAX_VALUE, problem)); + childrenList.add(new Property("careplan", "Reference(CarePlan)", "A reference to a specific care plan that prompted this assessment. The care plan provides further context for the assessment.", 0, java.lang.Integer.MAX_VALUE, careplan)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "A reference to a specific care plan that prompted this assessment. The referral request may provide further context for the assessment.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("investigations", "", "One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.", 0, java.lang.Integer.MAX_VALUE, investigations)); + childrenList.add(new Property("protocol", "uri", "Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.", 0, java.lang.Integer.MAX_VALUE, protocol)); + childrenList.add(new Property("summary", "string", "A text summary of the investigations and the diagnosis.", 0, java.lang.Integer.MAX_VALUE, summary)); + childrenList.add(new Property("diagnosis", "", "An specific diagnosis that was considered likely or relevant to ongoing treatment.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("resolved", "CodeableConcept", "Diagnoses/conditions resolved since the last assessment.", 0, java.lang.Integer.MAX_VALUE, resolved)); + childrenList.add(new Property("ruledOut", "", "Diagnosis considered not possible.", 0, java.lang.Integer.MAX_VALUE, ruledOut)); + childrenList.add(new Property("prognosis", "string", "Estimate of likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosis)); + childrenList.add(new Property("plan", "Reference(CarePlan)", "Plan of action after assessment.", 0, java.lang.Integer.MAX_VALUE, plan)); + childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationPrescription|DiagnosticOrder|NutritionOrder|Supply|Appointment)", "Actions taken during assessment.", 0, java.lang.Integer.MAX_VALUE, action)); + } + + public ClinicalAssessment copy() { + ClinicalAssessment dst = new ClinicalAssessment(); + copyValues(dst); + dst.patient = patient == null ? null : patient.copy(); + dst.assessor = assessor == null ? null : assessor.copy(); + dst.date = date == null ? null : date.copy(); + dst.description = description == null ? null : description.copy(); + dst.previous = previous == null ? null : previous.copy(); + if (problem != null) { + dst.problem = new ArrayList(); + for (Reference i : problem) + dst.problem.add(i.copy()); + }; + dst.careplan = careplan == null ? null : careplan.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (investigations != null) { + dst.investigations = new ArrayList(); + for (ClinicalAssessmentInvestigationsComponent i : investigations) + dst.investigations.add(i.copy()); + }; + dst.protocol = protocol == null ? null : protocol.copy(); + dst.summary = summary == null ? null : summary.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (ClinicalAssessmentDiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (resolved != null) { + dst.resolved = new ArrayList(); + for (CodeableConcept i : resolved) + dst.resolved.add(i.copy()); + }; + if (ruledOut != null) { + dst.ruledOut = new ArrayList(); + for (ClinicalAssessmentRuledOutComponent i : ruledOut) + dst.ruledOut.add(i.copy()); + }; + dst.prognosis = prognosis == null ? null : prognosis.copy(); + dst.plan = plan == null ? null : plan.copy(); + if (action != null) { + dst.action = new ArrayList(); + for (Reference i : action) + dst.action.add(i.copy()); + }; + return dst; + } + + protected ClinicalAssessment typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (patient == null || patient.isEmpty()) && (assessor == null || assessor.isEmpty()) + && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) && (previous == null || previous.isEmpty()) + && (problem == null || problem.isEmpty()) && (careplan == null || careplan.isEmpty()) && (referral == null || referral.isEmpty()) + && (investigations == null || investigations.isEmpty()) && (protocol == null || protocol.isEmpty()) + && (summary == null || summary.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) && (resolved == null || resolved.isEmpty()) + && (ruledOut == null || ruledOut.isEmpty()) && (prognosis == null || prognosis.isEmpty()) + && (plan == null || plan.isEmpty()) && (action == null || action.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ClinicalAssessment; + } + + @SearchParamDefinition(name="previous", path="ClinicalAssessment.previous", description="Reference to last assessment", type="reference" ) + public static final String SP_PREVIOUS = "previous"; + @SearchParamDefinition(name="referral", path="ClinicalAssessment.referral", description="A specific referral that lead to this assessment", type="reference" ) + public static final String SP_REFERRAL = "referral"; + @SearchParamDefinition(name="diagnosis", path="ClinicalAssessment.diagnosis.item", description="Specific text or code for diagnosis", type="token" ) + public static final String SP_DIAGNOSIS = "diagnosis"; + @SearchParamDefinition(name="problem", path="ClinicalAssessment.problem", description="General assessment of patient state", type="reference" ) + public static final String SP_PROBLEM = "problem"; + @SearchParamDefinition(name="date", path="ClinicalAssessment.date", description="When the assessment occurred", type="date" ) + public static final String SP_DATE = "date"; + @SearchParamDefinition(name="careplan", path="ClinicalAssessment.careplan", description="A specific careplan that prompted this assessment", type="reference" ) + public static final String SP_CAREPLAN = "careplan"; + @SearchParamDefinition(name="ruledout", path="ClinicalAssessment.ruledOut.item", description="Specific text of code for diagnosis", type="token" ) + public static final String SP_RULEDOUT = "ruledout"; + @SearchParamDefinition(name="assessor", path="ClinicalAssessment.assessor", description="The clinicial performing the assessment", type="reference" ) + public static final String SP_ASSESSOR = "assessor"; + @SearchParamDefinition(name="patient", path="ClinicalAssessment.patient", description="The patient being asssesed", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="resolved", path="ClinicalAssessment.resolved", description="Diagnosies/conditions resolved since previous assessment", type="token" ) + public static final String SP_RESOLVED = "resolved"; + @SearchParamDefinition(name="plan", path="ClinicalAssessment.plan", description="Plan of action after assessment", type="reference" ) + public static final String SP_PLAN = "plan"; + @SearchParamDefinition(name="action", path="ClinicalAssessment.action", description="Actions taken during assessment", type="reference" ) + public static final String SP_ACTION = "action"; + @SearchParamDefinition(name="investigation", path="ClinicalAssessment.investigations.item", description="Record of a specific investigation", type="reference" ) + public static final String SP_INVESTIGATION = "investigation"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeType.java index c41adfa53be..dc3084c4396 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeType.java @@ -28,8 +28,6 @@ POSSIBILITY OF SUCH DAMAGE. */ package org.hl7.fhir.instance.model; -import ca.uhn.fhir.model.api.annotation.SimpleSetter; -import ca.uhn.fhir.model.primitive.CodeDt; import org.hl7.fhir.instance.model.annotations.DatatypeDef; import static org.apache.commons.lang3.StringUtils.defaultString; @@ -40,6 +38,8 @@ import static org.apache.commons.lang3.StringUtils.defaultString; @DatatypeDef(name = "code") public class CodeType extends PrimitiveType implements Comparable { + private static final long serialVersionUID = 1L; + /** * Constructor */ diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java index 4aad61f7b2a..e4c984e69c8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CodeableConcept.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coding.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coding.java index 403601ae5cd..51ab763b2c2 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coding.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coding.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Communication.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Communication.java new file mode 100644 index 00000000000..6176743989e --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Communication.java @@ -0,0 +1,917 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. + */ +@ResourceDef(name="Communication", profile="http://hl7.org/fhir/Profile/Communication") +public class Communication extends DomainResource { + + public enum CommunicationStatus implements FhirEnum { + /** + * The communication transmission is ongoing. + */ + INPROGRESS, + /** + * The message transmission is complete, i.e., delivered to the recipient's destination. + */ + COMPLETED, + /** + * The communication transmission has been held by originating system/user request. + */ + SUSPENDED, + /** + * The receiving system has declined to accept the message. + */ + REJECTED, + /** + * There was a failure in transmitting the message out. + */ + FAILED, + /** + * added to help the parsers + */ + NULL; + + public static final CommunicationStatusEnumFactory ENUM_FACTORY = new CommunicationStatusEnumFactory(); + + public static CommunicationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("completed".equals(codeString)) + return COMPLETED; + if ("suspended".equals(codeString)) + return SUSPENDED; + if ("rejected".equals(codeString)) + return REJECTED; + if ("failed".equals(codeString)) + return FAILED; + throw new IllegalArgumentException("Unknown CommunicationStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case INPROGRESS: return "in progress"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case COMPLETED: return ""; + case SUSPENDED: return ""; + case REJECTED: return ""; + case FAILED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The communication transmission is ongoing."; + case COMPLETED: return "The message transmission is complete, i.e., delivered to the recipient's destination."; + case SUSPENDED: return "The communication transmission has been held by originating system/user request."; + case REJECTED: return "The receiving system has declined to accept the message."; + case FAILED: return "There was a failure in transmitting the message out."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "in progress"; + case COMPLETED: return "completed"; + case SUSPENDED: return "suspended"; + case REJECTED: return "rejected"; + case FAILED: return "failed"; + default: return "?"; + } + } + } + + public static class CommunicationStatusEnumFactory implements EnumFactory { + public CommunicationStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return CommunicationStatus.INPROGRESS; + if ("completed".equals(codeString)) + return CommunicationStatus.COMPLETED; + if ("suspended".equals(codeString)) + return CommunicationStatus.SUSPENDED; + if ("rejected".equals(codeString)) + return CommunicationStatus.REJECTED; + if ("failed".equals(codeString)) + return CommunicationStatus.FAILED; + throw new IllegalArgumentException("Unknown CommunicationStatus code '"+codeString+"'"); + } + public String toCode(CommunicationStatus code) throws IllegalArgumentException { + if (code == CommunicationStatus.INPROGRESS) + return "in progress"; + if (code == CommunicationStatus.COMPLETED) + return "completed"; + if (code == CommunicationStatus.SUSPENDED) + return "suspended"; + if (code == CommunicationStatus.REJECTED) + return "rejected"; + if (code == CommunicationStatus.FAILED) + return "failed"; + return "?"; + } + } + + @Block() + public static class CommunicationMessagePartComponent extends BackboneElement { + /** + * An individual message part for multi-part messages. + */ + @Child(name="content", type={StringType.class, Attachment.class}, order=1, min=1, max=1) + @Description(shortDefinition="Message part content", formalDefinition="An individual message part for multi-part messages." ) + protected Type content; + + private static final long serialVersionUID = -1763459053L; + + public CommunicationMessagePartComponent() { + super(); + } + + public CommunicationMessagePartComponent(Type content) { + super(); + this.content = content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public Type getContent() { + return this.content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public StringType getContentStringType() throws Exception { + if (!(this.content instanceof StringType)) + throw new Exception("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered"); + return (StringType) this.content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public Attachment getContentAttachment() throws Exception { + if (!(this.content instanceof Attachment)) + throw new Exception("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Attachment) this.content; + } + + /** + * @return {@link #content} (An individual message part for multi-part messages.) + */ + public Reference getContentReference() throws Exception { + if (!(this.content instanceof Reference)) + throw new Exception("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); + return (Reference) this.content; + } + + public boolean hasContent() { + return this.content != null && !this.content.isEmpty(); + } + + /** + * @param value {@link #content} (An individual message part for multi-part messages.) + */ + public CommunicationMessagePartComponent setContent(Type value) { + this.content = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("content[x]", "string|Attachment|Reference(Any)", "An individual message part for multi-part messages.", 0, java.lang.Integer.MAX_VALUE, content)); + } + + public CommunicationMessagePartComponent copy() { + CommunicationMessagePartComponent dst = new CommunicationMessagePartComponent(); + copyValues(dst); + dst.content = content == null ? null : content.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (content == null || content.isEmpty()); + } + + } + + /** + * Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Unique identifier", formalDefinition="Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * The type of message such as alert, notification, reminder, instruction, etc. + */ + @Child(name="category", type={CodeableConcept.class}, order=0, min=0, max=1) + @Description(shortDefinition="Message category", formalDefinition="The type of message such as alert, notification, reminder, instruction, etc." ) + protected CodeableConcept category; + + /** + * The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication. + */ + @Child(name="sender", type={Patient.class, Practitioner.class, Device.class, RelatedPerson.class, Organization.class}, order=1, min=0, max=1) + @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication." ) + protected Reference sender; + + /** + * The actual object that is the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.) + */ + protected Resource senderTarget; + + /** + * The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication. + */ + @Child(name="recipient", type={Patient.class, Device.class, RelatedPerson.class, Practitioner.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication." ) + protected List recipient; + /** + * The actual objects that are the target of the reference (The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.) + */ + protected List recipientTarget; + + + /** + * Text, attachment(s), or resource(s) to be communicated to the recipient. + */ + @Child(name="messagePart", type={}, order=3, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) to be communicated to the recipient." ) + protected List messagePart; + + /** + * The communication medium, e.g., email, fax. + */ + @Child(name="medium", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Communication medium", formalDefinition="The communication medium, e.g., email, fax." ) + protected List medium; + + /** + * The status of the transmission. + */ + @Child(name="status", type={CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="in progress | completed | suspended | rejected | failed", formalDefinition="The status of the transmission." ) + protected Enumeration status; + + /** + * The encounter within which the communication was sent. + */ + @Child(name="encounter", type={Encounter.class}, order=6, min=0, max=1) + @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication was sent." ) + protected Reference encounter; + + /** + * The actual object that is the target of the reference (The encounter within which the communication was sent.) + */ + protected Encounter encounterTarget; + + /** + * The time when this communication was sent. + */ + @Child(name="sent", type={DateTimeType.class}, order=7, min=0, max=1) + @Description(shortDefinition="When sent", formalDefinition="The time when this communication was sent." ) + protected DateTimeType sent; + + /** + * The time when this communication arrived at the destination. + */ + @Child(name="received", type={DateTimeType.class}, order=8, min=0, max=1) + @Description(shortDefinition="When received", formalDefinition="The time when this communication arrived at the destination." ) + protected DateTimeType received; + + /** + * The reason or justification for the communication. + */ + @Child(name="indication", type={CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication." ) + protected List indication; + + /** + * The patient who is the focus of this communication. + */ + @Child(name="subject", type={Patient.class}, order=10, min=1, max=1) + @Description(shortDefinition="Focus of message", formalDefinition="The patient who is the focus of this communication." ) + protected Reference subject; + + /** + * The actual object that is the target of the reference (The patient who is the focus of this communication.) + */ + protected Patient subjectTarget; + + private static final long serialVersionUID = -817648825L; + + public Communication() { + super(); + } + + public Communication(Reference subject) { + super(); + this.subject = subject; + } + + /** + * @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #category} (The type of message such as alert, notification, reminder, instruction, etc.) + */ + public CodeableConcept getCategory() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.category"); + else if (Configuration.doAutoCreate()) + this.category = new CodeableConcept(); + return this.category; + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (The type of message such as alert, notification, reminder, instruction, etc.) + */ + public Communication setCategory(CodeableConcept value) { + this.category = value; + return this; + } + + /** + * @return {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.) + */ + public Reference getSender() { + if (this.sender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.sender"); + else if (Configuration.doAutoCreate()) + this.sender = new Reference(); + return this.sender; + } + + public boolean hasSender() { + return this.sender != null && !this.sender.isEmpty(); + } + + /** + * @param value {@link #sender} (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.) + */ + public Communication setSender(Reference value) { + this.sender = value; + return this; + } + + /** + * @return {@link #sender} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.) + */ + public Resource getSenderTarget() { + return this.senderTarget; + } + + /** + * @param value {@link #sender} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.) + */ + public Communication setSenderTarget(Resource value) { + this.senderTarget = value; + return this; + } + + /** + * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.) + */ + public List getRecipient() { + if (this.recipient == null) + this.recipient = new ArrayList(); + return this.recipient; + } + + public boolean hasRecipient() { + if (this.recipient == null) + return false; + for (Reference item : this.recipient) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #recipient} (The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.) + */ + // syntactic sugar + public Reference addRecipient() { //3 + Reference t = new Reference(); + if (this.recipient == null) + this.recipient = new ArrayList(); + this.recipient.add(t); + return t; + } + + /** + * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.) + */ + public List getRecipientTarget() { + if (this.recipientTarget == null) + this.recipientTarget = new ArrayList(); + return this.recipientTarget; + } + + /** + * @return {@link #messagePart} (Text, attachment(s), or resource(s) to be communicated to the recipient.) + */ + public List getMessagePart() { + if (this.messagePart == null) + this.messagePart = new ArrayList(); + return this.messagePart; + } + + public boolean hasMessagePart() { + if (this.messagePart == null) + return false; + for (CommunicationMessagePartComponent item : this.messagePart) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #messagePart} (Text, attachment(s), or resource(s) to be communicated to the recipient.) + */ + // syntactic sugar + public CommunicationMessagePartComponent addMessagePart() { //3 + CommunicationMessagePartComponent t = new CommunicationMessagePartComponent(); + if (this.messagePart == null) + this.messagePart = new ArrayList(); + this.messagePart.add(t); + return t; + } + + /** + * @return {@link #medium} (The communication medium, e.g., email, fax.) + */ + public List getMedium() { + if (this.medium == null) + this.medium = new ArrayList(); + return this.medium; + } + + public boolean hasMedium() { + if (this.medium == null) + return false; + for (CodeableConcept item : this.medium) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #medium} (The communication medium, e.g., email, fax.) + */ + // syntactic sugar + public CodeableConcept addMedium() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.medium == null) + this.medium = new ArrayList(); + this.medium.add(t); + return t; + } + + /** + * @return {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Communication setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return The status of the transmission. + */ + public CommunicationStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value The status of the transmission. + */ + public Communication setStatus(CommunicationStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(CommunicationStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #encounter} (The encounter within which the communication was sent.) + */ + public Reference getEncounter() { + if (this.encounter == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.encounter"); + else if (Configuration.doAutoCreate()) + this.encounter = new Reference(); + return this.encounter; + } + + public boolean hasEncounter() { + return this.encounter != null && !this.encounter.isEmpty(); + } + + /** + * @param value {@link #encounter} (The encounter within which the communication was sent.) + */ + public Communication setEncounter(Reference value) { + this.encounter = value; + return this; + } + + /** + * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.) + */ + public Encounter getEncounterTarget() { + if (this.encounterTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.encounter"); + else if (Configuration.doAutoCreate()) + this.encounterTarget = new Encounter(); + return this.encounterTarget; + } + + /** + * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.) + */ + public Communication setEncounterTarget(Encounter value) { + this.encounterTarget = value; + return this; + } + + /** + * @return {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value + */ + public DateTimeType getSentElement() { + if (this.sent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.sent"); + else if (Configuration.doAutoCreate()) + this.sent = new DateTimeType(); + return this.sent; + } + + public boolean hasSentElement() { + return this.sent != null && !this.sent.isEmpty(); + } + + public boolean hasSent() { + return this.sent != null && !this.sent.isEmpty(); + } + + /** + * @param value {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value + */ + public Communication setSentElement(DateTimeType value) { + this.sent = value; + return this; + } + + /** + * @return The time when this communication was sent. + */ + public Date getSent() { + return this.sent == null ? null : this.sent.getValue(); + } + + /** + * @param value The time when this communication was sent. + */ + public Communication setSent(Date value) { + if (value == null) + this.sent = null; + else { + if (this.sent == null) + this.sent = new DateTimeType(); + this.sent.setValue(value); + } + return this; + } + + /** + * @return {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value + */ + public DateTimeType getReceivedElement() { + if (this.received == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.received"); + else if (Configuration.doAutoCreate()) + this.received = new DateTimeType(); + return this.received; + } + + public boolean hasReceivedElement() { + return this.received != null && !this.received.isEmpty(); + } + + public boolean hasReceived() { + return this.received != null && !this.received.isEmpty(); + } + + /** + * @param value {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value + */ + public Communication setReceivedElement(DateTimeType value) { + this.received = value; + return this; + } + + /** + * @return The time when this communication arrived at the destination. + */ + public Date getReceived() { + return this.received == null ? null : this.received.getValue(); + } + + /** + * @param value The time when this communication arrived at the destination. + */ + public Communication setReceived(Date value) { + if (value == null) + this.received = null; + else { + if (this.received == null) + this.received = new DateTimeType(); + this.received.setValue(value); + } + return this; + } + + /** + * @return {@link #indication} (The reason or justification for the communication.) + */ + public List getIndication() { + if (this.indication == null) + this.indication = new ArrayList(); + return this.indication; + } + + public boolean hasIndication() { + if (this.indication == null) + return false; + for (CodeableConcept item : this.indication) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #indication} (The reason or justification for the communication.) + */ + // syntactic sugar + public CodeableConcept addIndication() { //3 + CodeableConcept t = new CodeableConcept(); + if (this.indication == null) + this.indication = new ArrayList(); + this.indication.add(t); + return t; + } + + /** + * @return {@link #subject} (The patient who is the focus of this communication.) + */ + public Reference getSubject() { + if (this.subject == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.subject"); + else if (Configuration.doAutoCreate()) + this.subject = new Reference(); + return this.subject; + } + + public boolean hasSubject() { + return this.subject != null && !this.subject.isEmpty(); + } + + /** + * @param value {@link #subject} (The patient who is the focus of this communication.) + */ + public Communication setSubject(Reference value) { + this.subject = value; + return this; + } + + /** + * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication.) + */ + public Patient getSubjectTarget() { + if (this.subjectTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Communication.subject"); + else if (Configuration.doAutoCreate()) + this.subjectTarget = new Patient(); + return this.subjectTarget; + } + + /** + * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication.) + */ + public Communication setSubjectTarget(Patient value) { + this.subjectTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("category", "CodeableConcept", "The type of message such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("sender", "Reference(Patient|Practitioner|Device|RelatedPerson|Organization)", "The entity (e.g., person, organization, clinical information system, or device) which is the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender)); + childrenList.add(new Property("recipient", "Reference(Patient|Device|RelatedPerson|Practitioner)", "The entity (e.g., person, organization, clinical information system, or device) which is the target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient)); + childrenList.add(new Property("messagePart", "", "Text, attachment(s), or resource(s) to be communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, messagePart)); + childrenList.add(new Property("medium", "CodeableConcept", "The communication medium, e.g., email, fax.", 0, java.lang.Integer.MAX_VALUE, medium)); + childrenList.add(new Property("status", "code", "The status of the transmission.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication was sent.", 0, java.lang.Integer.MAX_VALUE, encounter)); + childrenList.add(new Property("sent", "dateTime", "The time when this communication was sent.", 0, java.lang.Integer.MAX_VALUE, sent)); + childrenList.add(new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, java.lang.Integer.MAX_VALUE, received)); + childrenList.add(new Property("indication", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, indication)); + childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the focus of this communication.", 0, java.lang.Integer.MAX_VALUE, subject)); + } + + public Communication copy() { + Communication dst = new Communication(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.category = category == null ? null : category.copy(); + dst.sender = sender == null ? null : sender.copy(); + if (recipient != null) { + dst.recipient = new ArrayList(); + for (Reference i : recipient) + dst.recipient.add(i.copy()); + }; + if (messagePart != null) { + dst.messagePart = new ArrayList(); + for (CommunicationMessagePartComponent i : messagePart) + dst.messagePart.add(i.copy()); + }; + if (medium != null) { + dst.medium = new ArrayList(); + for (CodeableConcept i : medium) + dst.medium.add(i.copy()); + }; + dst.status = status == null ? null : status.copy(); + dst.encounter = encounter == null ? null : encounter.copy(); + dst.sent = sent == null ? null : sent.copy(); + dst.received = received == null ? null : received.copy(); + if (indication != null) { + dst.indication = new ArrayList(); + for (CodeableConcept i : indication) + dst.indication.add(i.copy()); + }; + dst.subject = subject == null ? null : subject.copy(); + return dst; + } + + protected Communication typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) + && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (messagePart == null || messagePart.isEmpty()) + && (medium == null || medium.isEmpty()) && (status == null || status.isEmpty()) && (encounter == null || encounter.isEmpty()) + && (sent == null || sent.isEmpty()) && (received == null || received.isEmpty()) && (indication == null || indication.isEmpty()) + && (subject == null || subject.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Communication; + } + + @SearchParamDefinition(name="sender", path="Communication.sender", description="Message sender", type="reference" ) + public static final String SP_SENDER = "sender"; + @SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" ) + public static final String SP_SENT = "sent"; + @SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="patient", path="Communication.subject", description="Focus of message", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="status", path="Communication.status", description="in progress | completed | suspended | rejected | failed", type="token" ) + public static final String SP_STATUS = "status"; + @SearchParamDefinition(name="subject", path="Communication.subject", description="Focus of message", type="reference" ) + public static final String SP_SUBJECT = "subject"; + @SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" ) + public static final String SP_RECEIVED = "received"; + @SearchParamDefinition(name="encounter", path="Communication.encounter", description="Encounter leading to message", type="reference" ) + public static final String SP_ENCOUNTER = "encounter"; + @SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + @SearchParamDefinition(name="medium", path="Communication.medium", description="Communication medium", type="token" ) + public static final String SP_MEDIUM = "medium"; + @SearchParamDefinition(name="recipient", path="Communication.recipient", description="Message recipient", type="reference" ) + public static final String SP_RECIPIENT = "recipient"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java index fdb4a45308b..4b6c417dd04 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/CommunicationRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="CommunicationRequest", profile="http://hl7.org/fhir/Profile/CommunicationRequest") public class CommunicationRequest extends DomainResource { - public enum CommunicationRequestStatus { + public enum CommunicationRequestStatus implements FhirEnum { /** * The request has been placed. */ @@ -86,7 +86,10 @@ public class CommunicationRequest extends DomainResource { * added to help the parsers */ NULL; - public static CommunicationRequestStatus fromCode(String codeString) throws Exception { + + public static final CommunicationRequestStatusEnumFactory ENUM_FACTORY = new CommunicationRequestStatusEnumFactory(); + + public static CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("requested".equals(codeString)) @@ -107,8 +110,9 @@ public class CommunicationRequest extends DomainResource { return REJECTED; if ("failed".equals(codeString)) return FAILED; - throw new Exception("Unknown CommunicationRequestStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUESTED: return "requested"; @@ -167,8 +171,8 @@ public class CommunicationRequest extends DomainResource { } } - public static class CommunicationRequestStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class CommunicationRequestStatusEnumFactory implements EnumFactory { + public CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -190,9 +194,9 @@ public class CommunicationRequest extends DomainResource { return CommunicationRequestStatus.REJECTED; if ("failed".equals(codeString)) return CommunicationRequestStatus.FAILED; - throw new Exception("Unknown CommunicationRequestStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(CommunicationRequestStatus code) throws IllegalArgumentException { if (code == CommunicationRequestStatus.REQUESTED) return "requested"; if (code == CommunicationRequestStatus.RECEIVED) @@ -215,7 +219,7 @@ public class CommunicationRequest extends DomainResource { } } - public enum CommunicationRequestMode { + public enum CommunicationRequestMode implements FhirEnum { /** * planned. */ @@ -232,7 +236,10 @@ public class CommunicationRequest extends DomainResource { * added to help the parsers */ NULL; - public static CommunicationRequestMode fromCode(String codeString) throws Exception { + + public static final CommunicationRequestModeEnumFactory ENUM_FACTORY = new CommunicationRequestModeEnumFactory(); + + public static CommunicationRequestMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("planned".equals(codeString)) @@ -241,8 +248,9 @@ public class CommunicationRequest extends DomainResource { return PROPOSED; if ("ordered".equals(codeString)) return ORDERED; - throw new Exception("Unknown CommunicationRequestMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CommunicationRequestMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PLANNED: return "planned"; @@ -277,8 +285,8 @@ public class CommunicationRequest extends DomainResource { } } - public static class CommunicationRequestModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class CommunicationRequestModeEnumFactory implements EnumFactory { + public CommunicationRequestMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -288,9 +296,9 @@ public class CommunicationRequest extends DomainResource { return CommunicationRequestMode.PROPOSED; if ("ordered".equals(codeString)) return CommunicationRequestMode.ORDERED; - throw new Exception("Unknown CommunicationRequestMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CommunicationRequestMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(CommunicationRequestMode code) throws IllegalArgumentException { if (code == CommunicationRequestMode.PLANNED) return "planned"; if (code == CommunicationRequestMode.PROPOSED) @@ -800,7 +808,7 @@ public class CommunicationRequest extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(CommunicationRequestStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -849,7 +857,7 @@ public class CommunicationRequest extends DomainResource { this.mode = null; else { if (this.mode == null) - this.mode = new Enumeration(); + this.mode = new Enumeration(CommunicationRequestMode.ENUM_FACTORY); this.mode.setValue(value); } return this; @@ -930,14 +938,14 @@ public class CommunicationRequest extends DomainResource { /** * @return The time when this communication is to occur. */ - public DateAndTime getScheduledTime() { + public Date getScheduledTime() { return this.scheduledTime == null ? null : this.scheduledTime.getValue(); } /** * @param value The time when this communication is to occur. */ - public CommunicationRequest setScheduledTime(DateAndTime value) { + public CommunicationRequest setScheduledTime(Date value) { if (value == null) this.scheduledTime = null; else { @@ -1009,14 +1017,14 @@ public class CommunicationRequest extends DomainResource { /** * @return The time when the request was made. */ - public DateAndTime getOrderedOn() { + public Date getOrderedOn() { return this.orderedOn == null ? null : this.orderedOn.getValue(); } /** * @param value The time when the request was made. */ - public CommunicationRequest setOrderedOn(DateAndTime value) { + public CommunicationRequest setOrderedOn(Date value) { if (value == null) this.orderedOn = null; else { @@ -1195,10 +1203,10 @@ public class CommunicationRequest extends DomainResource { public static final String SP_TIME = "time"; @SearchParamDefinition(name="patient", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="ordered", path="CommunicationRequest.orderedOn", description="When ordered or proposed", type="date" ) - public static final String SP_ORDERED = "ordered"; @SearchParamDefinition(name="priority", path="CommunicationRequest.priority", description="Message urgency", type="token" ) public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="ordered", path="CommunicationRequest.orderedOn", description="When ordered or proposed", type="date" ) + public static final String SP_ORDERED = "ordered"; @SearchParamDefinition(name="identifier", path="CommunicationRequest.identifier", description="Unique identifier", type="token" ) public static final String SP_IDENTIFIER = "identifier"; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Composition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Composition.java index 4e4acbb9baa..ff3c3c17565 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Composition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Composition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Composition", profile="http://hl7.org/fhir/Profile/Composition") public class Composition extends DomainResource { - public enum CompositionStatus { + public enum CompositionStatus implements FhirEnum { /** * This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified. */ @@ -70,7 +70,10 @@ public class Composition extends DomainResource { * added to help the parsers */ NULL; - public static CompositionStatus fromCode(String codeString) throws Exception { + + public static final CompositionStatusEnumFactory ENUM_FACTORY = new CompositionStatusEnumFactory(); + + public static CompositionStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("preliminary".equals(codeString)) @@ -83,8 +86,9 @@ public class Composition extends DomainResource { return AMENDED; if ("entered in error".equals(codeString)) return ENTEREDINERROR; - throw new Exception("Unknown CompositionStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PRELIMINARY: return "preliminary"; @@ -127,8 +131,8 @@ public class Composition extends DomainResource { } } - public static class CompositionStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class CompositionStatusEnumFactory implements EnumFactory { + public CompositionStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -142,9 +146,9 @@ public class Composition extends DomainResource { return CompositionStatus.AMENDED; if ("entered in error".equals(codeString)) return CompositionStatus.ENTEREDINERROR; - throw new Exception("Unknown CompositionStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(CompositionStatus code) throws IllegalArgumentException { if (code == CompositionStatus.PRELIMINARY) return "preliminary"; if (code == CompositionStatus.FINAL) @@ -159,7 +163,7 @@ public class Composition extends DomainResource { } } - public enum CompositionAttestationMode { + public enum CompositionAttestationMode implements FhirEnum { /** * The person authenticated the content in their personal capacity. */ @@ -180,7 +184,10 @@ public class Composition extends DomainResource { * added to help the parsers */ NULL; - public static CompositionAttestationMode fromCode(String codeString) throws Exception { + + public static final CompositionAttestationModeEnumFactory ENUM_FACTORY = new CompositionAttestationModeEnumFactory(); + + public static CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("personal".equals(codeString)) @@ -191,8 +198,9 @@ public class Composition extends DomainResource { return LEGAL; if ("official".equals(codeString)) return OFFICIAL; - throw new Exception("Unknown CompositionAttestationMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PERSONAL: return "personal"; @@ -231,8 +239,8 @@ public class Composition extends DomainResource { } } - public static class CompositionAttestationModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class CompositionAttestationModeEnumFactory implements EnumFactory { + public CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -244,9 +252,9 @@ public class Composition extends DomainResource { return CompositionAttestationMode.LEGAL; if ("official".equals(codeString)) return CompositionAttestationMode.OFFICIAL; - throw new Exception("Unknown CompositionAttestationMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(CompositionAttestationMode code) throws IllegalArgumentException { if (code == CompositionAttestationMode.PERSONAL) return "personal"; if (code == CompositionAttestationMode.PROFESSIONAL) @@ -378,14 +386,14 @@ public class Composition extends DomainResource { /** * @return When composition was attested by the party. */ - public DateAndTime getTime() { + public Date getTime() { return this.time == null ? null : this.time.getValue(); } /** * @param value When composition was attested by the party. */ - public CompositionAttesterComponent setTime(DateAndTime value) { + public CompositionAttesterComponent setTime(Date value) { if (value == null) this.time = null; else { @@ -1020,14 +1028,14 @@ public class Composition extends DomainResource { /** * @return The composition editing time, when the composition was last logically changed by the author. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The composition editing time, when the composition was last logically changed by the author. */ - public Composition setDate(DateAndTime value) { + public Composition setDate(Date value) { if (this.date == null) this.date = new DateTimeType(); this.date.setValue(value); @@ -1171,7 +1179,7 @@ public class Composition extends DomainResource { */ public Composition setStatus(CompositionStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(CompositionStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1536,12 +1544,12 @@ public class Composition extends DomainResource { public static final String SP_SUBJECT = "subject"; @SearchParamDefinition(name="class", path="Composition.class", description="Categorization of Composition", type="token" ) public static final String SP_CLASS = "class"; + @SearchParamDefinition(name="period", path="Composition.event.period", description="The period covered by the documentation", type="date" ) + public static final String SP_PERIOD = "period"; @SearchParamDefinition(name="type", path="Composition.type", description="Kind of composition (LOINC if possible)", type="token" ) public static final String SP_TYPE = "type"; @SearchParamDefinition(name="date", path="Composition.date", description="Composition editing time", type="date" ) public static final String SP_DATE = "date"; - @SearchParamDefinition(name="period", path="Composition.event.period", description="The period covered by the documentation", type="date" ) - public static final String SP_PERIOD = "period"; @SearchParamDefinition(name="section", path="Composition.section.content", description="The Content of the section", type="reference" ) public static final String SP_SECTION = "section"; @SearchParamDefinition(name="author", path="Composition.author", description="Who and/or what authored the composition", type="reference" ) diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java index eb56cb6c4e4..22e86c4f1b6 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ConceptMap.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="ConceptMap", profile="http://hl7.org/fhir/Profile/ConceptMap") public class ConceptMap extends DomainResource { - public enum ValuesetStatus { + public enum ValuesetStatus implements FhirEnum { /** * This valueset is still under development. */ @@ -62,7 +62,10 @@ public class ConceptMap extends DomainResource { * added to help the parsers */ NULL; - public static ValuesetStatus fromCode(String codeString) throws Exception { + + public static final ValuesetStatusEnumFactory ENUM_FACTORY = new ValuesetStatusEnumFactory(); + + public static ValuesetStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("draft".equals(codeString)) @@ -71,8 +74,9 @@ public class ConceptMap extends DomainResource { return ACTIVE; if ("retired".equals(codeString)) return RETIRED; - throw new Exception("Unknown ValuesetStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DRAFT: return "draft"; @@ -107,8 +111,8 @@ public class ConceptMap extends DomainResource { } } - public static class ValuesetStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ValuesetStatusEnumFactory implements EnumFactory { + public ValuesetStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class ConceptMap extends DomainResource { return ValuesetStatus.ACTIVE; if ("retired".equals(codeString)) return ValuesetStatus.RETIRED; - throw new Exception("Unknown ValuesetStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ValuesetStatus code) throws IllegalArgumentException { if (code == ValuesetStatus.DRAFT) return "draft"; if (code == ValuesetStatus.ACTIVE) @@ -131,15 +135,15 @@ public class ConceptMap extends DomainResource { } } - public enum ConceptEquivalence { - /** - * The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical). - */ - EQUAL, + public enum ConceptEquivalence implements FhirEnum { /** * The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical). */ EQUIVALENT, + /** + * The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical). + */ + EQUAL, /** * The target mapping is wider in meaning than the source concept. */ @@ -157,7 +161,7 @@ public class ConceptMap extends DomainResource { */ SPECIALISES, /** - * The target mapping overlaps with the source concept, but both source and target cover additional meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally. + * The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally. */ INEXACT, /** @@ -172,13 +176,16 @@ public class ConceptMap extends DomainResource { * added to help the parsers */ NULL; - public static ConceptEquivalence fromCode(String codeString) throws Exception { + + public static final ConceptEquivalenceEnumFactory ENUM_FACTORY = new ConceptEquivalenceEnumFactory(); + + public static ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; - if ("equal".equals(codeString)) - return EQUAL; if ("equivalent".equals(codeString)) return EQUIVALENT; + if ("equal".equals(codeString)) + return EQUAL; if ("wider".equals(codeString)) return WIDER; if ("subsumes".equals(codeString)) @@ -193,12 +200,13 @@ public class ConceptMap extends DomainResource { return UNMATCHED; if ("disjoint".equals(codeString)) return DISJOINT; - throw new Exception("Unknown ConceptEquivalence code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { - case EQUAL: return "equal"; case EQUIVALENT: return "equivalent"; + case EQUAL: return "equal"; case WIDER: return "wider"; case SUBSUMES: return "subsumes"; case NARROWER: return "narrower"; @@ -211,8 +219,8 @@ public class ConceptMap extends DomainResource { } public String getSystem() { switch (this) { - case EQUAL: return ""; case EQUIVALENT: return ""; + case EQUAL: return ""; case WIDER: return ""; case SUBSUMES: return ""; case NARROWER: return ""; @@ -225,13 +233,13 @@ public class ConceptMap extends DomainResource { } public String getDefinition() { switch (this) { - case EQUAL: return "The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical)."; case EQUIVALENT: return "The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical)."; + case EQUAL: return "The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical)."; case WIDER: return "The target mapping is wider in meaning than the source concept."; case SUBSUMES: return "The target mapping subsumes the meaning of the source concept (e.g. the source is-a target)."; case NARROWER: return "The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally."; case SPECIALISES: return "The target mapping specialises the meaning of the source concept (e.g. the target is-a source)."; - case INEXACT: return "The target mapping overlaps with the source concept, but both source and target cover additional meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally."; + case INEXACT: return "The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally."; case UNMATCHED: return "There is no match for this concept in the destination concept system."; case DISJOINT: return "This is an explicit assertion that there is no mapping between the source and target concept."; default: return "?"; @@ -239,8 +247,8 @@ public class ConceptMap extends DomainResource { } public String getDisplay() { switch (this) { - case EQUAL: return "equal"; case EQUIVALENT: return "equivalent"; + case EQUAL: return "equal"; case WIDER: return "wider"; case SUBSUMES: return "subsumes"; case NARROWER: return "narrower"; @@ -253,15 +261,15 @@ public class ConceptMap extends DomainResource { } } - public static class ConceptEquivalenceEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ConceptEquivalenceEnumFactory implements EnumFactory { + public ConceptEquivalence fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; - if ("equal".equals(codeString)) - return ConceptEquivalence.EQUAL; if ("equivalent".equals(codeString)) return ConceptEquivalence.EQUIVALENT; + if ("equal".equals(codeString)) + return ConceptEquivalence.EQUAL; if ("wider".equals(codeString)) return ConceptEquivalence.WIDER; if ("subsumes".equals(codeString)) @@ -276,13 +284,13 @@ public class ConceptMap extends DomainResource { return ConceptEquivalence.UNMATCHED; if ("disjoint".equals(codeString)) return ConceptEquivalence.DISJOINT; - throw new Exception("Unknown ConceptEquivalence code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ConceptEquivalence code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { - if (code == ConceptEquivalence.EQUAL) - return "equal"; + public String toCode(ConceptEquivalence code) throws IllegalArgumentException { if (code == ConceptEquivalence.EQUIVALENT) return "equivalent"; + if (code == ConceptEquivalence.EQUAL) + return "equal"; if (code == ConceptEquivalence.WIDER) return "wider"; if (code == ConceptEquivalence.SUBSUMES) @@ -742,7 +750,7 @@ public class ConceptMap extends DomainResource { * The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target. */ @Child(name="equivalence", type={CodeType.class}, order=3, min=1, max=1) - @Description(shortDefinition="equal | equivalent | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint", formalDefinition="The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target." ) + @Description(shortDefinition="equivalent | equal | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint", formalDefinition="The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target." ) protected Enumeration equivalence; /** @@ -908,7 +916,7 @@ public class ConceptMap extends DomainResource { */ public ConceptMapElementMapComponent setEquivalence(ConceptEquivalence value) { if (this.equivalence == null) - this.equivalence = new Enumeration(); + this.equivalence = new Enumeration(ConceptEquivalence.ENUM_FACTORY); this.equivalence.setValue(value); return this; } @@ -1492,7 +1500,7 @@ public class ConceptMap extends DomainResource { */ public ConceptMap setStatus(ValuesetStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ValuesetStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1577,14 +1585,14 @@ public class ConceptMap extends DomainResource { /** * @return The date that the concept map status was last changed. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date that the concept map status was last changed. */ - public ConceptMap setDate(DateAndTime value) { + public ConceptMap setDate(Date value) { if (value == null) this.date = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Condition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Condition.java index f44d535d0a7..ad1194542e9 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Condition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Condition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Condition", profile="http://hl7.org/fhir/Profile/Condition") public class Condition extends DomainResource { - public enum ConditionStatus { + public enum ConditionStatus implements FhirEnum { /** * This is a tentative diagnosis - still a candidate that is under consideration. */ @@ -66,7 +66,10 @@ public class Condition extends DomainResource { * added to help the parsers */ NULL; - public static ConditionStatus fromCode(String codeString) throws Exception { + + public static final ConditionStatusEnumFactory ENUM_FACTORY = new ConditionStatusEnumFactory(); + + public static ConditionStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("provisional".equals(codeString)) @@ -77,8 +80,9 @@ public class Condition extends DomainResource { return CONFIRMED; if ("refuted".equals(codeString)) return REFUTED; - throw new Exception("Unknown ConditionStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PROVISIONAL: return "provisional"; @@ -117,8 +121,8 @@ public class Condition extends DomainResource { } } - public static class ConditionStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ConditionStatusEnumFactory implements EnumFactory { + public ConditionStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class Condition extends DomainResource { return ConditionStatus.CONFIRMED; if ("refuted".equals(codeString)) return ConditionStatus.REFUTED; - throw new Exception("Unknown ConditionStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ConditionStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ConditionStatus code) throws IllegalArgumentException { if (code == ConditionStatus.PROVISIONAL) return "provisional"; if (code == ConditionStatus.WORKING) @@ -1055,14 +1059,14 @@ public class Condition extends DomainResource { /** * @return Estimated or actual date the condition/problem/diagnosis was first detected/suspected. */ - public DateAndTime getDateAsserted() { + public Date getDateAsserted() { return this.dateAsserted == null ? null : this.dateAsserted.getValue(); } /** * @param value Estimated or actual date the condition/problem/diagnosis was first detected/suspected. */ - public Condition setDateAsserted(DateAndTime value) { + public Condition setDateAsserted(Date value) { if (value == null) this.dateAsserted = null; else { @@ -1161,7 +1165,7 @@ public class Condition extends DomainResource { */ public Condition setStatus(ConditionStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ConditionStatus.ENUM_FACTORY); this.status.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Configuration.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Configuration.java index 057b9a25751..40f69c6884b 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Configuration.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Configuration.java @@ -90,9 +90,9 @@ POSSIBILITY OF SUCH DAMAGE. public class Configuration { private static int status = 0; - // 0: auto-create - // 1: error - // 2: return null + // 0: auto-create + // 1: error + // 2: return null public static boolean errorOnAutoCreate() { return status == 1; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Conformance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Conformance.java index 87b810e2695..cea429c315e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Conformance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Conformance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Conformance", profile="http://hl7.org/fhir/Profile/Conformance") public class Conformance extends DomainResource { - public enum ConformanceStatementStatus { + public enum ConformanceStatementStatus implements FhirEnum { /** * This conformance statement is still under development. */ @@ -62,7 +62,10 @@ public class Conformance extends DomainResource { * added to help the parsers */ NULL; - public static ConformanceStatementStatus fromCode(String codeString) throws Exception { + + public static final ConformanceStatementStatusEnumFactory ENUM_FACTORY = new ConformanceStatementStatusEnumFactory(); + + public static ConformanceStatementStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("draft".equals(codeString)) @@ -71,8 +74,9 @@ public class Conformance extends DomainResource { return ACTIVE; if ("retired".equals(codeString)) return RETIRED; - throw new Exception("Unknown ConformanceStatementStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ConformanceStatementStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DRAFT: return "draft"; @@ -107,8 +111,8 @@ public class Conformance extends DomainResource { } } - public static class ConformanceStatementStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ConformanceStatementStatusEnumFactory implements EnumFactory { + public ConformanceStatementStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class Conformance extends DomainResource { return ConformanceStatementStatus.ACTIVE; if ("retired".equals(codeString)) return ConformanceStatementStatus.RETIRED; - throw new Exception("Unknown ConformanceStatementStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ConformanceStatementStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ConformanceStatementStatus code) throws IllegalArgumentException { if (code == ConformanceStatementStatus.DRAFT) return "draft"; if (code == ConformanceStatementStatus.ACTIVE) @@ -131,7 +135,7 @@ public class Conformance extends DomainResource { } } - public enum RestfulConformanceMode { + public enum RestfulConformanceMode implements FhirEnum { /** * The application acts as a server for this resource. */ @@ -144,15 +148,19 @@ public class Conformance extends DomainResource { * added to help the parsers */ NULL; - public static RestfulConformanceMode fromCode(String codeString) throws Exception { + + public static final RestfulConformanceModeEnumFactory ENUM_FACTORY = new RestfulConformanceModeEnumFactory(); + + public static RestfulConformanceMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("client".equals(codeString)) return CLIENT; if ("server".equals(codeString)) return SERVER; - throw new Exception("Unknown RestfulConformanceMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case CLIENT: return "client"; @@ -183,8 +191,8 @@ public class Conformance extends DomainResource { } } - public static class RestfulConformanceModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class RestfulConformanceModeEnumFactory implements EnumFactory { + public RestfulConformanceMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -192,9 +200,9 @@ public class Conformance extends DomainResource { return RestfulConformanceMode.CLIENT; if ("server".equals(codeString)) return RestfulConformanceMode.SERVER; - throw new Exception("Unknown RestfulConformanceMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(RestfulConformanceMode code) throws IllegalArgumentException { if (code == RestfulConformanceMode.CLIENT) return "client"; if (code == RestfulConformanceMode.SERVER) @@ -203,7 +211,7 @@ public class Conformance extends DomainResource { } } - public enum TypeRestfulInteraction { + public enum TypeRestfulInteraction implements FhirEnum { /** * */ @@ -244,7 +252,10 @@ public class Conformance extends DomainResource { * added to help the parsers */ NULL; - public static TypeRestfulInteraction fromCode(String codeString) throws Exception { + + public static final TypeRestfulInteractionEnumFactory ENUM_FACTORY = new TypeRestfulInteractionEnumFactory(); + + public static TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("read".equals(codeString)) @@ -265,8 +276,9 @@ public class Conformance extends DomainResource { return CREATE; if ("search-type".equals(codeString)) return SEARCHTYPE; - throw new Exception("Unknown TypeRestfulInteraction code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case READ: return "read"; @@ -325,8 +337,8 @@ public class Conformance extends DomainResource { } } - public static class TypeRestfulInteractionEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class TypeRestfulInteractionEnumFactory implements EnumFactory { + public TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -348,9 +360,9 @@ public class Conformance extends DomainResource { return TypeRestfulInteraction.CREATE; if ("search-type".equals(codeString)) return TypeRestfulInteraction.SEARCHTYPE; - throw new Exception("Unknown TypeRestfulInteraction code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(TypeRestfulInteraction code) throws IllegalArgumentException { if (code == TypeRestfulInteraction.READ) return "read"; if (code == TypeRestfulInteraction.VREAD) @@ -373,7 +385,7 @@ public class Conformance extends DomainResource { } } - public enum VersioningPolicy { + public enum VersioningPolicy implements FhirEnum { /** * VersionId meta-property is not suppoerted (server) or used (client). */ @@ -390,7 +402,10 @@ public class Conformance extends DomainResource { * added to help the parsers */ NULL; - public static VersioningPolicy fromCode(String codeString) throws Exception { + + public static final VersioningPolicyEnumFactory ENUM_FACTORY = new VersioningPolicyEnumFactory(); + + public static VersioningPolicy fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("no-version".equals(codeString)) @@ -399,8 +414,9 @@ public class Conformance extends DomainResource { return VERSIONED; if ("versioned-update".equals(codeString)) return VERSIONEDUPDATE; - throw new Exception("Unknown VersioningPolicy code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case NOVERSION: return "no-version"; @@ -435,8 +451,8 @@ public class Conformance extends DomainResource { } } - public static class VersioningPolicyEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class VersioningPolicyEnumFactory implements EnumFactory { + public VersioningPolicy fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -446,9 +462,9 @@ public class Conformance extends DomainResource { return VersioningPolicy.VERSIONED; if ("versioned-update".equals(codeString)) return VersioningPolicy.VERSIONEDUPDATE; - throw new Exception("Unknown VersioningPolicy code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown VersioningPolicy code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(VersioningPolicy code) throws IllegalArgumentException { if (code == VersioningPolicy.NOVERSION) return "no-version"; if (code == VersioningPolicy.VERSIONED) @@ -459,7 +475,7 @@ public class Conformance extends DomainResource { } } - public enum SearchParamType { + public enum SearchParamType implements FhirEnum { /** * Search parameter SHALL be a number (a whole number, or a decimal). */ @@ -492,7 +508,10 @@ public class Conformance extends DomainResource { * added to help the parsers */ NULL; - public static SearchParamType fromCode(String codeString) throws Exception { + + public static final SearchParamTypeEnumFactory ENUM_FACTORY = new SearchParamTypeEnumFactory(); + + public static SearchParamType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("number".equals(codeString)) @@ -509,8 +528,9 @@ public class Conformance extends DomainResource { return COMPOSITE; if ("quantity".equals(codeString)) return QUANTITY; - throw new Exception("Unknown SearchParamType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case NUMBER: return "number"; @@ -561,8 +581,8 @@ public class Conformance extends DomainResource { } } - public static class SearchParamTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class SearchParamTypeEnumFactory implements EnumFactory { + public SearchParamType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -580,9 +600,9 @@ public class Conformance extends DomainResource { return SearchParamType.COMPOSITE; if ("quantity".equals(codeString)) return SearchParamType.QUANTITY; - throw new Exception("Unknown SearchParamType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(SearchParamType code) throws IllegalArgumentException { if (code == SearchParamType.NUMBER) return "number"; if (code == SearchParamType.DATE) @@ -601,7 +621,7 @@ public class Conformance extends DomainResource { } } - public enum SystemRestfulInteraction { + public enum SystemRestfulInteraction implements FhirEnum { /** * */ @@ -618,7 +638,10 @@ public class Conformance extends DomainResource { * added to help the parsers */ NULL; - public static SystemRestfulInteraction fromCode(String codeString) throws Exception { + + public static final SystemRestfulInteractionEnumFactory ENUM_FACTORY = new SystemRestfulInteractionEnumFactory(); + + public static SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("transaction".equals(codeString)) @@ -627,8 +650,9 @@ public class Conformance extends DomainResource { return SEARCHSYSTEM; if ("history-system".equals(codeString)) return HISTORYSYSTEM; - throw new Exception("Unknown SystemRestfulInteraction code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case TRANSACTION: return "transaction"; @@ -663,8 +687,8 @@ public class Conformance extends DomainResource { } } - public static class SystemRestfulInteractionEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class SystemRestfulInteractionEnumFactory implements EnumFactory { + public SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -674,9 +698,9 @@ public class Conformance extends DomainResource { return SystemRestfulInteraction.SEARCHSYSTEM; if ("history-system".equals(codeString)) return SystemRestfulInteraction.HISTORYSYSTEM; - throw new Exception("Unknown SystemRestfulInteraction code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(SystemRestfulInteraction code) throws IllegalArgumentException { if (code == SystemRestfulInteraction.TRANSACTION) return "transaction"; if (code == SystemRestfulInteraction.SEARCHSYSTEM) @@ -687,7 +711,7 @@ public class Conformance extends DomainResource { } } - public enum MessageSignificanceCategory { + public enum MessageSignificanceCategory implements FhirEnum { /** * The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment. */ @@ -704,7 +728,10 @@ public class Conformance extends DomainResource { * added to help the parsers */ NULL; - public static MessageSignificanceCategory fromCode(String codeString) throws Exception { + + public static final MessageSignificanceCategoryEnumFactory ENUM_FACTORY = new MessageSignificanceCategoryEnumFactory(); + + public static MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("Consequence".equals(codeString)) @@ -713,8 +740,9 @@ public class Conformance extends DomainResource { return CURRENCY; if ("Notification".equals(codeString)) return NOTIFICATION; - throw new Exception("Unknown MessageSignificanceCategory code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case CONSEQUENCE: return "Consequence"; @@ -749,8 +777,8 @@ public class Conformance extends DomainResource { } } - public static class MessageSignificanceCategoryEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class MessageSignificanceCategoryEnumFactory implements EnumFactory { + public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -760,9 +788,9 @@ public class Conformance extends DomainResource { return MessageSignificanceCategory.CURRENCY; if ("Notification".equals(codeString)) return MessageSignificanceCategory.NOTIFICATION; - throw new Exception("Unknown MessageSignificanceCategory code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(MessageSignificanceCategory code) throws IllegalArgumentException { if (code == MessageSignificanceCategory.CONSEQUENCE) return "Consequence"; if (code == MessageSignificanceCategory.CURRENCY) @@ -773,7 +801,7 @@ public class Conformance extends DomainResource { } } - public enum MessageConformanceEventMode { + public enum MessageConformanceEventMode implements FhirEnum { /** * The application sends requests and receives responses. */ @@ -786,15 +814,19 @@ public class Conformance extends DomainResource { * added to help the parsers */ NULL; - public static MessageConformanceEventMode fromCode(String codeString) throws Exception { + + public static final MessageConformanceEventModeEnumFactory ENUM_FACTORY = new MessageConformanceEventModeEnumFactory(); + + public static MessageConformanceEventMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("sender".equals(codeString)) return SENDER; if ("receiver".equals(codeString)) return RECEIVER; - throw new Exception("Unknown MessageConformanceEventMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case SENDER: return "sender"; @@ -825,8 +857,8 @@ public class Conformance extends DomainResource { } } - public static class MessageConformanceEventModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class MessageConformanceEventModeEnumFactory implements EnumFactory { + public MessageConformanceEventMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -834,9 +866,9 @@ public class Conformance extends DomainResource { return MessageConformanceEventMode.SENDER; if ("receiver".equals(codeString)) return MessageConformanceEventMode.RECEIVER; - throw new Exception("Unknown MessageConformanceEventMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MessageConformanceEventMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(MessageConformanceEventMode code) throws IllegalArgumentException { if (code == MessageConformanceEventMode.SENDER) return "sender"; if (code == MessageConformanceEventMode.RECEIVER) @@ -845,7 +877,7 @@ public class Conformance extends DomainResource { } } - public enum DocumentMode { + public enum DocumentMode implements FhirEnum { /** * The application produces documents of the specified type. */ @@ -858,15 +890,19 @@ public class Conformance extends DomainResource { * added to help the parsers */ NULL; - public static DocumentMode fromCode(String codeString) throws Exception { + + public static final DocumentModeEnumFactory ENUM_FACTORY = new DocumentModeEnumFactory(); + + public static DocumentMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("producer".equals(codeString)) return PRODUCER; if ("consumer".equals(codeString)) return CONSUMER; - throw new Exception("Unknown DocumentMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PRODUCER: return "producer"; @@ -897,8 +933,8 @@ public class Conformance extends DomainResource { } } - public static class DocumentModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DocumentModeEnumFactory implements EnumFactory { + public DocumentMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -906,9 +942,9 @@ public class Conformance extends DomainResource { return DocumentMode.PRODUCER; if ("consumer".equals(codeString)) return DocumentMode.CONSUMER; - throw new Exception("Unknown DocumentMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DocumentMode code) throws IllegalArgumentException { if (code == DocumentMode.PRODUCER) return "producer"; if (code == DocumentMode.CONSUMER) @@ -1076,14 +1112,14 @@ public class Conformance extends DomainResource { /** * @return Date this version of the software released. */ - public DateAndTime getReleaseDate() { + public Date getReleaseDate() { return this.releaseDate == null ? null : this.releaseDate.getValue(); } /** * @param value Date this version of the software released. */ - public ConformanceSoftwareComponent setReleaseDate(DateAndTime value) { + public ConformanceSoftwareComponent setReleaseDate(Date value) { if (value == null) this.releaseDate = null; else { @@ -1361,7 +1397,7 @@ public class Conformance extends DomainResource { */ public ConformanceRestComponent setMode(RestfulConformanceMode value) { if (this.mode == null) - this.mode = new Enumeration(); + this.mode = new Enumeration(RestfulConformanceMode.ENUM_FACTORY); this.mode.setValue(value); return this; } @@ -2237,7 +2273,7 @@ public class Conformance extends DomainResource { this.versioning = null; else { if (this.versioning == null) - this.versioning = new Enumeration(); + this.versioning = new Enumeration(VersioningPolicy.ENUM_FACTORY); this.versioning.setValue(value); } return this; @@ -2540,7 +2576,7 @@ public class Conformance extends DomainResource { */ public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { if (this.code == null) - this.code = new Enumeration(); + this.code = new Enumeration(TypeRestfulInteraction.ENUM_FACTORY); this.code.setValue(value); return this; } @@ -2805,7 +2841,7 @@ public class Conformance extends DomainResource { */ public ConformanceRestResourceSearchParamComponent setType(SearchParamType value) { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(SearchParamType.ENUM_FACTORY); this.type.setValue(value); return this; } @@ -3072,7 +3108,7 @@ public class Conformance extends DomainResource { */ public SystemInteractionComponent setCode(SystemRestfulInteraction value) { if (this.code == null) - this.code = new Enumeration(); + this.code = new Enumeration(SystemRestfulInteraction.ENUM_FACTORY); this.code.setValue(value); return this; } @@ -3683,7 +3719,7 @@ public class Conformance extends DomainResource { this.category = null; else { if (this.category == null) - this.category = new Enumeration(); + this.category = new Enumeration(MessageSignificanceCategory.ENUM_FACTORY); this.category.setValue(value); } return this; @@ -3729,7 +3765,7 @@ public class Conformance extends DomainResource { */ public ConformanceMessagingEventComponent setMode(MessageConformanceEventMode value) { if (this.mode == null) - this.mode = new Enumeration(); + this.mode = new Enumeration(MessageConformanceEventMode.ENUM_FACTORY); this.mode.setValue(value); return this; } @@ -4065,7 +4101,7 @@ public class Conformance extends DomainResource { */ public ConformanceDocumentComponent setMode(DocumentMode value) { if (this.mode == null) - this.mode = new Enumeration(); + this.mode = new Enumeration(DocumentMode.ENUM_FACTORY); this.mode.setValue(value); return this; } @@ -4645,7 +4681,7 @@ public class Conformance extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ConformanceStatementStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -4731,14 +4767,14 @@ public class Conformance extends DomainResource { /** * @return The date (and optionally time) when the conformance statement was published. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date (and optionally time) when the conformance statement was published. */ - public Conformance setDate(DateAndTime value) { + public Conformance setDate(Date value) { if (this.date == null) this.date = new DateTimeType(); this.date.setValue(value); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Constants.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Constants.java index 3ccfa3c3370..7dc4806c364 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Constants.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Constants.java @@ -29,12 +29,12 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 public class Constants { public final static String VERSION = "0.3.0"; - public final static String REVISION = "3637"; - public final static String DATE = "Tue Dec 02 21:09:20 EST 2014"; + public final static String REVISION = "3775"; + public final static String DATE = "Sun Dec 07 21:45:56 EST 2014"; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java index ebecffd7942..0e43af29f01 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ContactPoint.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef; @DatatypeDef(name="ContactPoint") public class ContactPoint extends Type { - public enum ContactPointSystem { + public enum ContactPointSystem implements FhirEnum { /** * The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. */ @@ -64,7 +64,10 @@ public class ContactPoint extends Type { * added to help the parsers */ NULL; - public static ContactPointSystem fromCode(String codeString) throws Exception { + + public static final ContactPointSystemEnumFactory ENUM_FACTORY = new ContactPointSystemEnumFactory(); + + public static ContactPointSystem fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("phone".equals(codeString)) @@ -75,8 +78,9 @@ public class ContactPoint extends Type { return EMAIL; if ("url".equals(codeString)) return URL; - throw new Exception("Unknown ContactPointSystem code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PHONE: return "phone"; @@ -115,8 +119,8 @@ public class ContactPoint extends Type { } } - public static class ContactPointSystemEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ContactPointSystemEnumFactory implements EnumFactory { + public ContactPointSystem fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -128,9 +132,9 @@ public class ContactPoint extends Type { return ContactPointSystem.EMAIL; if ("url".equals(codeString)) return ContactPointSystem.URL; - throw new Exception("Unknown ContactPointSystem code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ContactPointSystem code) throws IllegalArgumentException { if (code == ContactPointSystem.PHONE) return "phone"; if (code == ContactPointSystem.FAX) @@ -143,7 +147,7 @@ public class ContactPoint extends Type { } } - public enum ContactPointUse { + public enum ContactPointUse implements FhirEnum { /** * A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available. */ @@ -168,7 +172,10 @@ public class ContactPoint extends Type { * added to help the parsers */ NULL; - public static ContactPointUse fromCode(String codeString) throws Exception { + + public static final ContactPointUseEnumFactory ENUM_FACTORY = new ContactPointUseEnumFactory(); + + public static ContactPointUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("home".equals(codeString)) @@ -181,8 +188,9 @@ public class ContactPoint extends Type { return OLD; if ("mobile".equals(codeString)) return MOBILE; - throw new Exception("Unknown ContactPointUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case HOME: return "home"; @@ -225,8 +233,8 @@ public class ContactPoint extends Type { } } - public static class ContactPointUseEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ContactPointUseEnumFactory implements EnumFactory { + public ContactPointUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -240,9 +248,9 @@ public class ContactPoint extends Type { return ContactPointUse.OLD; if ("mobile".equals(codeString)) return ContactPointUse.MOBILE; - throw new Exception("Unknown ContactPointUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ContactPointUse code) throws IllegalArgumentException { if (code == ContactPointUse.HOME) return "home"; if (code == ContactPointUse.WORK) @@ -334,7 +342,7 @@ public class ContactPoint extends Type { this.system = null; else { if (this.system == null) - this.system = new Enumeration(); + this.system = new Enumeration(ContactPointSystem.ENUM_FACTORY); this.system.setValue(value); } return this; @@ -432,7 +440,7 @@ public class ContactPoint extends Type { this.use = null; else { if (this.use == null) - this.use = new Enumeration(); + this.use = new Enumeration(ContactPointUse.ENUM_FACTORY); this.use.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contract.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contract.java index a68f20771d6..8aa28a67fc8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contract.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contract.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -51,114 +51,123 @@ public class Contract extends DomainResource { /** * Party or role who is signing. */ - @Child(name="type", type={Coding.class}, order=1, min=1, max=1) + @Child(name="type", type={Coding.class}, order=1, min=1, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Signer Type", formalDefinition="Party or role who is signing." ) - protected Coding type; + protected List type; /** * The DSIG signature contents in Base64. */ - @Child(name="singnature", type={StringType.class}, order=2, min=1, max=1) + @Child(name="signature", type={StringType.class}, order=2, min=1, max=1) @Description(shortDefinition="Documentation Signature", formalDefinition="The DSIG signature contents in Base64." ) - protected StringType singnature; + protected StringType signature; - private static final long serialVersionUID = -825583495L; + private static final long serialVersionUID = 584509693L; public ContractSignerComponent() { super(); } - public ContractSignerComponent(Coding type, StringType singnature) { + public ContractSignerComponent(StringType signature) { super(); - this.type = type; - this.singnature = singnature; + this.signature = signature; } /** * @return {@link #type} (Party or role who is signing.) */ - public Coding getType() { + public List getType() { if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractSignerComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); + this.type = new ArrayList(); return this.type; } public boolean hasType() { - return this.type != null && !this.type.isEmpty(); + if (this.type == null) + return false; + for (Coding item : this.type) + if (!item.isEmpty()) + return true; + return false; } /** - * @param value {@link #type} (Party or role who is signing.) + * @return {@link #type} (Party or role who is signing.) */ - public ContractSignerComponent setType(Coding value) { - this.type = value; - return this; + // syntactic sugar + public Coding addType() { //3 + Coding t = new Coding(); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); + return t; } /** - * @return {@link #singnature} (The DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSingnature" gives direct access to the value + * @return {@link #signature} (The DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value */ - public StringType getSingnatureElement() { - if (this.singnature == null) + public StringType getSignatureElement() { + if (this.signature == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContractSignerComponent.singnature"); + throw new Error("Attempt to auto-create ContractSignerComponent.signature"); else if (Configuration.doAutoCreate()) - this.singnature = new StringType(); - return this.singnature; + this.signature = new StringType(); + return this.signature; } - public boolean hasSingnatureElement() { - return this.singnature != null && !this.singnature.isEmpty(); + public boolean hasSignatureElement() { + return this.signature != null && !this.signature.isEmpty(); } - public boolean hasSingnature() { - return this.singnature != null && !this.singnature.isEmpty(); + public boolean hasSignature() { + return this.signature != null && !this.signature.isEmpty(); } /** - * @param value {@link #singnature} (The DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSingnature" gives direct access to the value + * @param value {@link #signature} (The DSIG signature contents in Base64.). This is the underlying object with id, value and extensions. The accessor "getSignature" gives direct access to the value */ - public ContractSignerComponent setSingnatureElement(StringType value) { - this.singnature = value; + public ContractSignerComponent setSignatureElement(StringType value) { + this.signature = value; return this; } /** * @return The DSIG signature contents in Base64. */ - public String getSingnature() { - return this.singnature == null ? null : this.singnature.getValue(); + public String getSignature() { + return this.signature == null ? null : this.signature.getValue(); } /** * @param value The DSIG signature contents in Base64. */ - public ContractSignerComponent setSingnature(String value) { - if (this.singnature == null) - this.singnature = new StringType(); - this.singnature.setValue(value); + public ContractSignerComponent setSignature(String value) { + if (this.signature == null) + this.signature = new StringType(); + this.signature.setValue(value); return this; } protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("type", "Coding", "Party or role who is signing.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("singnature", "string", "The DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, singnature)); + childrenList.add(new Property("signature", "string", "The DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature)); } public ContractSignerComponent copy() { ContractSignerComponent dst = new ContractSignerComponent(); copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.singnature = singnature == null ? null : singnature.copy(); + if (type != null) { + dst.type = new ArrayList(); + for (Coding i : type) + dst.type.add(i.copy()); + }; + dst.signature = signature == null ? null : signature.copy(); return dst; } public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (singnature == null || singnature.isEmpty()) + return super.isEmpty() && (type == null || type.isEmpty()) && (signature == null || signature.isEmpty()) ; } @@ -181,10 +190,10 @@ public class Contract extends DomainResource { protected CodeableConcept type; /** - * The subttype of the term which is appropriate to the term type. + * The subtype of the term which is appropriate to the term type. */ @Child(name="subtype", type={CodeableConcept.class}, order=3, min=0, max=1) - @Description(shortDefinition="Term subtype", formalDefinition="The subttype of the term which is appropriate to the term type." ) + @Description(shortDefinition="Term subtype", formalDefinition="The subtype of the term which is appropriate to the term type." ) protected CodeableConcept subtype; /** @@ -203,10 +212,59 @@ public class Contract extends DomainResource { * Human readable form of the term of the contract. */ @Child(name="text", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="Human readable term text", formalDefinition="Human readable form of the term of the contract." ) + @Description(shortDefinition="Human readable Term text", formalDefinition="Human readable form of the term of the contract." ) protected StringType text; - private static final long serialVersionUID = -697165954L; + /** + * When this term was issued. + */ + @Child(name="issued", type={DateTimeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="When issued", formalDefinition="When this term was issued." ) + protected DateTimeType issued; + + /** + * Relevant time/time-period when the term is applicable. + */ + @Child(name="applies", type={Period.class}, order=7, min=0, max=1) + @Description(shortDefinition="When effective", formalDefinition="Relevant time/time-period when the term is applicable." ) + protected Period applies; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The unit price product. + */ + @Child(name="unitPrice", type={Money.class}, order=9, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The unit price product." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=11, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=12, min=0, max=1) + @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + private static final long serialVersionUID = -1958595473L; public ContractTermComponent() { super(); @@ -261,7 +319,7 @@ public class Contract extends DomainResource { } /** - * @return {@link #subtype} (The subttype of the term which is appropriate to the term type.) + * @return {@link #subtype} (The subtype of the term which is appropriate to the term type.) */ public CodeableConcept getSubtype() { if (this.subtype == null) @@ -277,7 +335,7 @@ public class Contract extends DomainResource { } /** - * @param value {@link #subtype} (The subttype of the term which is appropriate to the term type.) + * @param value {@link #subtype} (The subtype of the term which is appropriate to the term type.) */ public ContractTermComponent setSubtype(CodeableConcept value) { this.subtype = value; @@ -372,13 +430,263 @@ public class Contract extends DomainResource { return this; } + /** + * @return {@link #issued} (When this term was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public DateTimeType getIssuedElement() { + if (this.issued == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.issued"); + else if (Configuration.doAutoCreate()) + this.issued = new DateTimeType(); + return this.issued; + } + + public boolean hasIssuedElement() { + return this.issued != null && !this.issued.isEmpty(); + } + + public boolean hasIssued() { + return this.issued != null && !this.issued.isEmpty(); + } + + /** + * @param value {@link #issued} (When this term was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value + */ + public ContractTermComponent setIssuedElement(DateTimeType value) { + this.issued = value; + return this; + } + + /** + * @return When this term was issued. + */ + public Date getIssued() { + return this.issued == null ? null : this.issued.getValue(); + } + + /** + * @param value When this term was issued. + */ + public ContractTermComponent setIssued(Date value) { + if (value == null) + this.issued = null; + else { + if (this.issued == null) + this.issued = new DateTimeType(); + this.issued.setValue(value); + } + return this; + } + + /** + * @return {@link #applies} (Relevant time/time-period when the term is applicable.) + */ + public Period getApplies() { + if (this.applies == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.applies"); + else if (Configuration.doAutoCreate()) + this.applies = new Period(); + return this.applies; + } + + public boolean hasApplies() { + return this.applies != null && !this.applies.isEmpty(); + } + + /** + * @param value {@link #applies} (Relevant time/time-period when the term is applicable.) + */ + public ContractTermComponent setApplies(Period value) { + this.applies = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ContractTermComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The unit price product.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The unit price product.) + */ + public ContractTermComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ContractTermComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ContractTermComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ContractTermComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public ContractTermComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ContractTermComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public ContractTermComponent setNet(Money value) { + this.net = value; + return this; + } + protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "Unique Id for this particular term.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("type", "CodeableConcept", "The type of the term.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subtype", "CodeableConcept", "The subttype of the term which is appropriate to the term type.", 0, java.lang.Integer.MAX_VALUE, subtype)); + childrenList.add(new Property("subtype", "CodeableConcept", "The subtype of the term which is appropriate to the term type.", 0, java.lang.Integer.MAX_VALUE, subtype)); childrenList.add(new Property("subject", "Reference(Any)", "Who or what the contract term is about.", 0, java.lang.Integer.MAX_VALUE, subject)); childrenList.add(new Property("text", "string", "Human readable form of the term of the contract.", 0, java.lang.Integer.MAX_VALUE, text)); + childrenList.add(new Property("issued", "dateTime", "When this term was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); + childrenList.add(new Property("applies", "Period", "Relevant time/time-period when the term is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The unit price product.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); } public ContractTermComponent copy() { @@ -389,13 +697,22 @@ public class Contract extends DomainResource { dst.subtype = subtype == null ? null : subtype.copy(); dst.subject = subject == null ? null : subject.copy(); dst.text = text == null ? null : text.copy(); + dst.issued = issued == null ? null : issued.copy(); + dst.applies = applies == null ? null : applies.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); return dst; } public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) && (subject == null || subject.isEmpty()) && (text == null || text.isEmpty()) - ; + && (issued == null || issued.isEmpty()) && (applies == null || applies.isEmpty()) && (quantity == null || quantity.isEmpty()) + && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) + && (net == null || net.isEmpty()); } } @@ -419,73 +736,97 @@ public class Contract extends DomainResource { protected List subjectTarget; + /** + * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. + */ + @Child(name="authority", type={Organization.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Authority", formalDefinition="A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc." ) + protected List authority; + /** + * The actual objects that are the target of the reference (A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + protected List authorityTarget; + + + /** + * A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations. + */ + @Child(name="domain", type={Location.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Domain", formalDefinition="A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations." ) + protected List domain; + /** + * The actual objects that are the target of the reference (A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + protected List domainTarget; + + /** * Type of contract (Privacy-Security, Agreement, Insurance). */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=1) + @Child(name="type", type={CodeableConcept.class}, order=3, min=0, max=1) @Description(shortDefinition="Type of contract", formalDefinition="Type of contract (Privacy-Security, Agreement, Insurance)." ) protected CodeableConcept type; /** * More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat). */ - @Child(name="subtype", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) + @Child(name="subtype", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Subtype of contract", formalDefinition="More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat)." ) protected List subtype; /** * When this was issued. */ - @Child(name="issued", type={DateTimeType.class}, order=3, min=0, max=1) + @Child(name="issued", type={DateTimeType.class}, order=5, min=0, max=1) @Description(shortDefinition="When this was issued", formalDefinition="When this was issued." ) protected DateTimeType issued; /** * Relevant time/time-period when applicable. */ - @Child(name="applies", type={Period.class}, order=4, min=0, max=1) + @Child(name="applies", type={Period.class}, order=6, min=0, max=1) @Description(shortDefinition="Effective time", formalDefinition="Relevant time/time-period when applicable." ) protected Period applies; /** * The number of repetitions of a service or product. */ - @Child(name="quantity", type={Quantity.class}, order=5, min=0, max=1) + @Child(name="quantity", type={Quantity.class}, order=7, min=0, max=1) @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) protected Quantity quantity; /** * The unit price product. */ - @Child(name="unitPrice", type={Money.class}, order=6, min=0, max=1) + @Child(name="unitPrice", type={Money.class}, order=8, min=0, max=1) @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The unit price product." ) protected Money unitPrice; /** * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. */ - @Child(name="factor", type={DecimalType.class}, order=7, min=0, max=1) + @Child(name="factor", type={DecimalType.class}, order=9, min=0, max=1) @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) protected DecimalType factor; /** * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. */ - @Child(name="points", type={DecimalType.class}, order=8, min=0, max=1) + @Child(name="points", type={DecimalType.class}, order=10, min=0, max=1) @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) protected DecimalType points; /** * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. */ - @Child(name="net", type={Money.class}, order=9, min=0, max=1) + @Child(name="net", type={Money.class}, order=11, min=0, max=1) @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) protected Money net; /** * Contract author or responsible party. */ - @Child(name="author", type={Practitioner.class, RelatedPerson.class, Organization.class}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Child(name="author", type={Practitioner.class, RelatedPerson.class, Organization.class}, order=12, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Contract author or responsible party", formalDefinition="Contract author or responsible party." ) protected List author; /** @@ -497,7 +838,7 @@ public class Contract extends DomainResource { /** * First Party to the contract, may be the party who confers or delegates the rights defined in the contract. */ - @Child(name="grantor", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=11, min=0, max=Child.MAX_UNLIMITED) + @Child(name="grantor", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=13, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="First Party or delegator", formalDefinition="First Party to the contract, may be the party who confers or delegates the rights defined in the contract." ) protected List grantor; /** @@ -509,7 +850,7 @@ public class Contract extends DomainResource { /** * The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated. */ - @Child(name="grantee", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Child(name="grantee", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=14, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Second Party or delegatee", formalDefinition="The Second party to the contract, may be the party who accepts obligations or be that to which rights are delegated." ) protected List grantee; /** @@ -521,7 +862,7 @@ public class Contract extends DomainResource { /** * Who witnesses the contract. */ - @Child(name="witness", type={Practitioner.class, RelatedPerson.class, Patient.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Child(name="witness", type={Practitioner.class, RelatedPerson.class, Patient.class}, order=15, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Witness to the contract", formalDefinition="Who witnesses the contract." ) protected List witness; /** @@ -533,7 +874,7 @@ public class Contract extends DomainResource { /** * First Party to the contract, may be the party who confers or delegates the rights defined in the contract. */ - @Child(name="executor", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Child(name="executor", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=16, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Trustee", formalDefinition="First Party to the contract, may be the party who confers or delegates the rights defined in the contract." ) protected List executor; /** @@ -545,7 +886,7 @@ public class Contract extends DomainResource { /** * First Party to the contract, may be the party who confers or delegates the rights defined in the contract. */ - @Child(name="notary", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Child(name="notary", type={Practitioner.class, RelatedPerson.class, Organization.class, Patient.class}, order=17, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Notary Public", formalDefinition="First Party to the contract, may be the party who confers or delegates the rights defined in the contract." ) protected List notary; /** @@ -557,39 +898,74 @@ public class Contract extends DomainResource { /** * List or contract signatures. */ - @Child(name="signer", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Child(name="signer", type={}, order=18, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Signer", formalDefinition="List or contract signatures." ) protected List signer; /** - * A contract provision. + * The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time. */ - @Child(name="term", type={}, order=17, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Contract provisions", formalDefinition="A contract provision." ) + @Child(name="term", type={}, order=19, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="The terms of the Contract", formalDefinition="The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time." ) protected List term; + /** + * Legally binding contract. + */ + @Child(name="binding", type={Attachment.class}, order=20, min=0, max=1) + @Description(shortDefinition="Binding Contract", formalDefinition="Legally binding contract." ) + protected Attachment binding; + + /** + * Relevant time/time-period when applicable. + */ + @Child(name="bindingDateTime", type={DateTimeType.class}, order=21, min=0, max=1) + @Description(shortDefinition="Binding Contract effective time", formalDefinition="Relevant time/time-period when applicable." ) + protected DateTimeType bindingDateTime; + /** * Friendly Human readable form (might be a reference to the UI used to capture the contract). */ - @Child(name="friendly", type={Attachment.class}, order=18, min=0, max=1) + @Child(name="friendly", type={Attachment.class}, order=22, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Human readable contract text", formalDefinition="Friendly Human readable form (might be a reference to the UI used to capture the contract)." ) - protected Attachment friendly; + protected List friendly; + + /** + * Relevant time/time-period when applicable. + */ + @Child(name="friendlyDateTime", type={DateTimeType.class}, order=23, min=0, max=1) + @Description(shortDefinition="Human readable contract text effective time", formalDefinition="Relevant time/time-period when applicable." ) + protected DateTimeType friendlyDateTime; /** * Legal text in Human readable form. */ - @Child(name="legal", type={Attachment.class}, order=19, min=0, max=1) + @Child(name="legal", type={Attachment.class}, order=24, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Legal contract text", formalDefinition="Legal text in Human readable form." ) - protected Attachment legal; + protected List legal; + + /** + * Relevant time/time-period when applicable. + */ + @Child(name="legalDateTime", type={DateTimeType.class}, order=25, min=0, max=1) + @Description(shortDefinition="Legal contract text date time", formalDefinition="Relevant time/time-period when applicable." ) + protected DateTimeType legalDateTime; /** * Computable Policy rules (e.g. XACML, DKAL, SecPal). */ - @Child(name="rule", type={Attachment.class}, order=20, min=0, max=1) + @Child(name="rule", type={Attachment.class}, order=26, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Computable contract text", formalDefinition="Computable Policy rules (e.g. XACML, DKAL, SecPal)." ) - protected Attachment rule; + protected List rule; - private static final long serialVersionUID = -1421847454L; + /** + * Relevant time/time-period when applicable. + */ + @Child(name="ruleDateTime", type={DateTimeType.class}, order=27, min=0, max=1) + @Description(shortDefinition="Computable contract text effect time", formalDefinition="Relevant time/time-period when applicable." ) + protected DateTimeType ruleDateTime; + + private static final long serialVersionUID = -467568093L; public Contract() { super(); @@ -664,6 +1040,108 @@ public class Contract extends DomainResource { return this.subjectTarget; } + /** + * @return {@link #authority} (A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + public List getAuthority() { + if (this.authority == null) + this.authority = new ArrayList(); + return this.authority; + } + + public boolean hasAuthority() { + if (this.authority == null) + return false; + for (Reference item : this.authority) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #authority} (A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + // syntactic sugar + public Reference addAuthority() { //3 + Reference t = new Reference(); + if (this.authority == null) + this.authority = new ArrayList(); + this.authority.add(t); + return t; + } + + /** + * @return {@link #authority} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + public List getAuthorityTarget() { + if (this.authorityTarget == null) + this.authorityTarget = new ArrayList(); + return this.authorityTarget; + } + + // syntactic sugar + /** + * @return {@link #authority} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.) + */ + public Organization addAuthorityTarget() { + Organization r = new Organization(); + if (this.authorityTarget == null) + this.authorityTarget = new ArrayList(); + this.authorityTarget.add(r); + return r; + } + + /** + * @return {@link #domain} (A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + public List getDomain() { + if (this.domain == null) + this.domain = new ArrayList(); + return this.domain; + } + + public boolean hasDomain() { + if (this.domain == null) + return false; + for (Reference item : this.domain) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #domain} (A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + // syntactic sugar + public Reference addDomain() { //3 + Reference t = new Reference(); + if (this.domain == null) + this.domain = new ArrayList(); + this.domain.add(t); + return t; + } + + /** + * @return {@link #domain} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + public List getDomainTarget() { + if (this.domainTarget == null) + this.domainTarget = new ArrayList(); + return this.domainTarget; + } + + // syntactic sugar + /** + * @return {@link #domain} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.) + */ + public Location addDomainTarget() { + Location r = new Location(); + if (this.domainTarget == null) + this.domainTarget = new ArrayList(); + this.domainTarget.add(r); + return r; + } + /** * @return {@link #type} (Type of contract (Privacy-Security, Agreement, Insurance).) */ @@ -749,14 +1227,14 @@ public class Contract extends DomainResource { /** * @return When this was issued. */ - public DateAndTime getIssued() { + public Date getIssued() { return this.issued == null ? null : this.issued.getValue(); } /** * @param value When this was issued. */ - public Contract setIssued(DateAndTime value) { + public Contract setIssued(Date value) { if (value == null) this.issued = null; else { @@ -1226,7 +1704,7 @@ public class Contract extends DomainResource { } /** - * @return {@link #term} (A contract provision.) + * @return {@link #term} (The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.) */ public List getTerm() { if (this.term == null) @@ -1244,7 +1722,7 @@ public class Contract extends DomainResource { } /** - * @return {@link #term} (A contract provision.) + * @return {@link #term} (The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.) */ // syntactic sugar public ContractTermComponent addTerm() { //3 @@ -1255,75 +1733,313 @@ public class Contract extends DomainResource { return t; } + /** + * @return {@link #binding} (Legally binding contract.) + */ + public Attachment getBinding() { + if (this.binding == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.binding"); + else if (Configuration.doAutoCreate()) + this.binding = new Attachment(); + return this.binding; + } + + public boolean hasBinding() { + return this.binding != null && !this.binding.isEmpty(); + } + + /** + * @param value {@link #binding} (Legally binding contract.) + */ + public Contract setBinding(Attachment value) { + this.binding = value; + return this; + } + + /** + * @return {@link #bindingDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getBindingDateTime" gives direct access to the value + */ + public DateTimeType getBindingDateTimeElement() { + if (this.bindingDateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.bindingDateTime"); + else if (Configuration.doAutoCreate()) + this.bindingDateTime = new DateTimeType(); + return this.bindingDateTime; + } + + public boolean hasBindingDateTimeElement() { + return this.bindingDateTime != null && !this.bindingDateTime.isEmpty(); + } + + public boolean hasBindingDateTime() { + return this.bindingDateTime != null && !this.bindingDateTime.isEmpty(); + } + + /** + * @param value {@link #bindingDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getBindingDateTime" gives direct access to the value + */ + public Contract setBindingDateTimeElement(DateTimeType value) { + this.bindingDateTime = value; + return this; + } + + /** + * @return Relevant time/time-period when applicable. + */ + public Date getBindingDateTime() { + return this.bindingDateTime == null ? null : this.bindingDateTime.getValue(); + } + + /** + * @param value Relevant time/time-period when applicable. + */ + public Contract setBindingDateTime(Date value) { + if (value == null) + this.bindingDateTime = null; + else { + if (this.bindingDateTime == null) + this.bindingDateTime = new DateTimeType(); + this.bindingDateTime.setValue(value); + } + return this; + } + /** * @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).) */ - public Attachment getFriendly() { + public List getFriendly() { if (this.friendly == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.friendly"); - else if (Configuration.doAutoCreate()) - this.friendly = new Attachment(); + this.friendly = new ArrayList(); return this.friendly; } public boolean hasFriendly() { - return this.friendly != null && !this.friendly.isEmpty(); + if (this.friendly == null) + return false; + for (Attachment item : this.friendly) + if (!item.isEmpty()) + return true; + return false; } /** - * @param value {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).) + * @return {@link #friendly} (Friendly Human readable form (might be a reference to the UI used to capture the contract).) */ - public Contract setFriendly(Attachment value) { - this.friendly = value; + // syntactic sugar + public Attachment addFriendly() { //3 + Attachment t = new Attachment(); + if (this.friendly == null) + this.friendly = new ArrayList(); + this.friendly.add(t); + return t; + } + + /** + * @return {@link #friendlyDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getFriendlyDateTime" gives direct access to the value + */ + public DateTimeType getFriendlyDateTimeElement() { + if (this.friendlyDateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.friendlyDateTime"); + else if (Configuration.doAutoCreate()) + this.friendlyDateTime = new DateTimeType(); + return this.friendlyDateTime; + } + + public boolean hasFriendlyDateTimeElement() { + return this.friendlyDateTime != null && !this.friendlyDateTime.isEmpty(); + } + + public boolean hasFriendlyDateTime() { + return this.friendlyDateTime != null && !this.friendlyDateTime.isEmpty(); + } + + /** + * @param value {@link #friendlyDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getFriendlyDateTime" gives direct access to the value + */ + public Contract setFriendlyDateTimeElement(DateTimeType value) { + this.friendlyDateTime = value; + return this; + } + + /** + * @return Relevant time/time-period when applicable. + */ + public Date getFriendlyDateTime() { + return this.friendlyDateTime == null ? null : this.friendlyDateTime.getValue(); + } + + /** + * @param value Relevant time/time-period when applicable. + */ + public Contract setFriendlyDateTime(Date value) { + if (value == null) + this.friendlyDateTime = null; + else { + if (this.friendlyDateTime == null) + this.friendlyDateTime = new DateTimeType(); + this.friendlyDateTime.setValue(value); + } return this; } /** * @return {@link #legal} (Legal text in Human readable form.) */ - public Attachment getLegal() { + public List getLegal() { if (this.legal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.legal"); - else if (Configuration.doAutoCreate()) - this.legal = new Attachment(); + this.legal = new ArrayList(); return this.legal; } public boolean hasLegal() { - return this.legal != null && !this.legal.isEmpty(); + if (this.legal == null) + return false; + for (Attachment item : this.legal) + if (!item.isEmpty()) + return true; + return false; } /** - * @param value {@link #legal} (Legal text in Human readable form.) + * @return {@link #legal} (Legal text in Human readable form.) */ - public Contract setLegal(Attachment value) { - this.legal = value; + // syntactic sugar + public Attachment addLegal() { //3 + Attachment t = new Attachment(); + if (this.legal == null) + this.legal = new ArrayList(); + this.legal.add(t); + return t; + } + + /** + * @return {@link #legalDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getLegalDateTime" gives direct access to the value + */ + public DateTimeType getLegalDateTimeElement() { + if (this.legalDateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.legalDateTime"); + else if (Configuration.doAutoCreate()) + this.legalDateTime = new DateTimeType(); + return this.legalDateTime; + } + + public boolean hasLegalDateTimeElement() { + return this.legalDateTime != null && !this.legalDateTime.isEmpty(); + } + + public boolean hasLegalDateTime() { + return this.legalDateTime != null && !this.legalDateTime.isEmpty(); + } + + /** + * @param value {@link #legalDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getLegalDateTime" gives direct access to the value + */ + public Contract setLegalDateTimeElement(DateTimeType value) { + this.legalDateTime = value; + return this; + } + + /** + * @return Relevant time/time-period when applicable. + */ + public Date getLegalDateTime() { + return this.legalDateTime == null ? null : this.legalDateTime.getValue(); + } + + /** + * @param value Relevant time/time-period when applicable. + */ + public Contract setLegalDateTime(Date value) { + if (value == null) + this.legalDateTime = null; + else { + if (this.legalDateTime == null) + this.legalDateTime = new DateTimeType(); + this.legalDateTime.setValue(value); + } return this; } /** * @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).) */ - public Attachment getRule() { + public List getRule() { if (this.rule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.rule"); - else if (Configuration.doAutoCreate()) - this.rule = new Attachment(); + this.rule = new ArrayList(); return this.rule; } public boolean hasRule() { - return this.rule != null && !this.rule.isEmpty(); + if (this.rule == null) + return false; + for (Attachment item : this.rule) + if (!item.isEmpty()) + return true; + return false; } /** - * @param value {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).) + * @return {@link #rule} (Computable Policy rules (e.g. XACML, DKAL, SecPal).) */ - public Contract setRule(Attachment value) { - this.rule = value; + // syntactic sugar + public Attachment addRule() { //3 + Attachment t = new Attachment(); + if (this.rule == null) + this.rule = new ArrayList(); + this.rule.add(t); + return t; + } + + /** + * @return {@link #ruleDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getRuleDateTime" gives direct access to the value + */ + public DateTimeType getRuleDateTimeElement() { + if (this.ruleDateTime == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Contract.ruleDateTime"); + else if (Configuration.doAutoCreate()) + this.ruleDateTime = new DateTimeType(); + return this.ruleDateTime; + } + + public boolean hasRuleDateTimeElement() { + return this.ruleDateTime != null && !this.ruleDateTime.isEmpty(); + } + + public boolean hasRuleDateTime() { + return this.ruleDateTime != null && !this.ruleDateTime.isEmpty(); + } + + /** + * @param value {@link #ruleDateTime} (Relevant time/time-period when applicable.). This is the underlying object with id, value and extensions. The accessor "getRuleDateTime" gives direct access to the value + */ + public Contract setRuleDateTimeElement(DateTimeType value) { + this.ruleDateTime = value; + return this; + } + + /** + * @return Relevant time/time-period when applicable. + */ + public Date getRuleDateTime() { + return this.ruleDateTime == null ? null : this.ruleDateTime.getValue(); + } + + /** + * @param value Relevant time/time-period when applicable. + */ + public Contract setRuleDateTime(Date value) { + if (value == null) + this.ruleDateTime = null; + else { + if (this.ruleDateTime == null) + this.ruleDateTime = new DateTimeType(); + this.ruleDateTime.setValue(value); + } return this; } @@ -1331,6 +2047,8 @@ public class Contract extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "Unique Id for this contract.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("subject", "Reference(Any)", "Who and/or what this is about: typically Patient, Organization, property.", 0, java.lang.Integer.MAX_VALUE, subject)); + childrenList.add(new Property("authority", "Reference(Organization)", "A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.", 0, java.lang.Integer.MAX_VALUE, authority)); + childrenList.add(new Property("domain", "Reference(Location)", "A Location includes both incidental locations (a place which is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations.", 0, java.lang.Integer.MAX_VALUE, domain)); childrenList.add(new Property("type", "CodeableConcept", "Type of contract (Privacy-Security, Agreement, Insurance).", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("subtype", "CodeableConcept", "More specific type of contract (Privacy, Disclosure-Authorization, Advanced-Directive, DNR, Authorization-to-Treat).", 0, java.lang.Integer.MAX_VALUE, subtype)); childrenList.add(new Property("issued", "dateTime", "When this was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); @@ -1347,10 +2065,15 @@ public class Contract extends DomainResource { childrenList.add(new Property("executor", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "First Party to the contract, may be the party who confers or delegates the rights defined in the contract.", 0, java.lang.Integer.MAX_VALUE, executor)); childrenList.add(new Property("notary", "Reference(Practitioner|RelatedPerson|Organization|Patient)", "First Party to the contract, may be the party who confers or delegates the rights defined in the contract.", 0, java.lang.Integer.MAX_VALUE, notary)); childrenList.add(new Property("signer", "", "List or contract signatures.", 0, java.lang.Integer.MAX_VALUE, signer)); - childrenList.add(new Property("term", "", "A contract provision.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("term", "", "The itemized terms of the contract. The legal clause or conditions of the Contract that requires or prevents either one or both parties to perform a particular requirement by some specified time.", 0, java.lang.Integer.MAX_VALUE, term)); + childrenList.add(new Property("binding", "Attachment", "Legally binding contract.", 0, java.lang.Integer.MAX_VALUE, binding)); + childrenList.add(new Property("bindingDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, bindingDateTime)); childrenList.add(new Property("friendly", "Attachment", "Friendly Human readable form (might be a reference to the UI used to capture the contract).", 0, java.lang.Integer.MAX_VALUE, friendly)); + childrenList.add(new Property("friendlyDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, friendlyDateTime)); childrenList.add(new Property("legal", "Attachment", "Legal text in Human readable form.", 0, java.lang.Integer.MAX_VALUE, legal)); + childrenList.add(new Property("legalDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, legalDateTime)); childrenList.add(new Property("rule", "Attachment", "Computable Policy rules (e.g. XACML, DKAL, SecPal).", 0, java.lang.Integer.MAX_VALUE, rule)); + childrenList.add(new Property("ruleDateTime", "dateTime", "Relevant time/time-period when applicable.", 0, java.lang.Integer.MAX_VALUE, ruleDateTime)); } public Contract copy() { @@ -1366,6 +2089,16 @@ public class Contract extends DomainResource { for (Reference i : subject) dst.subject.add(i.copy()); }; + if (authority != null) { + dst.authority = new ArrayList(); + for (Reference i : authority) + dst.authority.add(i.copy()); + }; + if (domain != null) { + dst.domain = new ArrayList(); + for (Reference i : domain) + dst.domain.add(i.copy()); + }; dst.type = type == null ? null : type.copy(); if (subtype != null) { dst.subtype = new ArrayList(); @@ -1419,9 +2152,26 @@ public class Contract extends DomainResource { for (ContractTermComponent i : term) dst.term.add(i.copy()); }; - dst.friendly = friendly == null ? null : friendly.copy(); - dst.legal = legal == null ? null : legal.copy(); - dst.rule = rule == null ? null : rule.copy(); + dst.binding = binding == null ? null : binding.copy(); + dst.bindingDateTime = bindingDateTime == null ? null : bindingDateTime.copy(); + if (friendly != null) { + dst.friendly = new ArrayList(); + for (Attachment i : friendly) + dst.friendly.add(i.copy()); + }; + dst.friendlyDateTime = friendlyDateTime == null ? null : friendlyDateTime.copy(); + if (legal != null) { + dst.legal = new ArrayList(); + for (Attachment i : legal) + dst.legal.add(i.copy()); + }; + dst.legalDateTime = legalDateTime == null ? null : legalDateTime.copy(); + if (rule != null) { + dst.rule = new ArrayList(); + for (Attachment i : rule) + dst.rule.add(i.copy()); + }; + dst.ruleDateTime = ruleDateTime == null ? null : ruleDateTime.copy(); return dst; } @@ -1431,13 +2181,17 @@ public class Contract extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) && (issued == null || issued.isEmpty()) - && (applies == null || applies.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (authority == null || authority.isEmpty()) && (domain == null || domain.isEmpty()) && (type == null || type.isEmpty()) + && (subtype == null || subtype.isEmpty()) && (issued == null || issued.isEmpty()) && (applies == null || applies.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) && (author == null || author.isEmpty()) && (grantor == null || grantor.isEmpty()) && (grantee == null || grantee.isEmpty()) && (witness == null || witness.isEmpty()) && (executor == null || executor.isEmpty()) && (notary == null || notary.isEmpty()) - && (signer == null || signer.isEmpty()) && (term == null || term.isEmpty()) && (friendly == null || friendly.isEmpty()) - && (legal == null || legal.isEmpty()) && (rule == null || rule.isEmpty()); + && (signer == null || signer.isEmpty()) && (term == null || term.isEmpty()) && (binding == null || binding.isEmpty()) + && (bindingDateTime == null || bindingDateTime.isEmpty()) && (friendly == null || friendly.isEmpty()) + && (friendlyDateTime == null || friendlyDateTime.isEmpty()) && (legal == null || legal.isEmpty()) + && (legalDateTime == null || legalDateTime.isEmpty()) && (rule == null || rule.isEmpty()) + && (ruleDateTime == null || ruleDateTime.isEmpty()); } @Override diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contraindication.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contraindication.java index 969e5cb77fa..67c94ac88b3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contraindication.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Contraindication.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -139,14 +139,14 @@ public class Contraindication extends DomainResource { /** * @return Indicates when the mitigating action was documented. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value Indicates when the mitigating action was documented. */ - public ContraindicationMitigationComponent setDate(DateAndTime value) { + public ContraindicationMitigationComponent setDate(Date value) { if (value == null) this.date = null; else { @@ -551,14 +551,14 @@ public class Contraindication extends DomainResource { /** * @return The date or date-time when the contraindication was initially identified. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date or date-time when the contraindication was initially identified. */ - public Contraindication setDate(DateAndTime value) { + public Contraindication setDate(Date value) { if (value == null) this.date = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Count.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Count.java index 9fd6689e996..8f2c08ce505 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Count.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Count.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import org.hl7.fhir.instance.model.annotations.DatatypeDef; /** diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coverage.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coverage.java index cf511d08516..47f56f1b9cf 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coverage.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Coverage.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DataElement.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DataElement.java index 76e39dcabd3..0a5f176ff17 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DataElement.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DataElement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="DataElement", profile="http://hl7.org/fhir/Profile/DataElement") public class DataElement extends DomainResource { - public enum ResourceObservationDefStatus { + public enum ResourceObservationDefStatus implements FhirEnum { /** * This data element is still under development. */ @@ -62,7 +62,10 @@ public class DataElement extends DomainResource { * added to help the parsers */ NULL; - public static ResourceObservationDefStatus fromCode(String codeString) throws Exception { + + public static final ResourceObservationDefStatusEnumFactory ENUM_FACTORY = new ResourceObservationDefStatusEnumFactory(); + + public static ResourceObservationDefStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("draft".equals(codeString)) @@ -71,8 +74,9 @@ public class DataElement extends DomainResource { return ACTIVE; if ("retired".equals(codeString)) return RETIRED; - throw new Exception("Unknown ResourceObservationDefStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceObservationDefStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DRAFT: return "draft"; @@ -107,8 +111,8 @@ public class DataElement extends DomainResource { } } - public static class ResourceObservationDefStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ResourceObservationDefStatusEnumFactory implements EnumFactory { + public ResourceObservationDefStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class DataElement extends DomainResource { return ResourceObservationDefStatus.ACTIVE; if ("retired".equals(codeString)) return ResourceObservationDefStatus.RETIRED; - throw new Exception("Unknown ResourceObservationDefStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceObservationDefStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ResourceObservationDefStatus code) throws IllegalArgumentException { if (code == ResourceObservationDefStatus.DRAFT) return "draft"; if (code == ResourceObservationDefStatus.ACTIVE) @@ -131,7 +135,7 @@ public class DataElement extends DomainResource { } } - public enum BindingConformance { + public enum BindingConformance implements FhirEnum { /** * Only codes in the specified set are allowed. If the binding is extensible, other codes may be used for concepts not covered by the bound set of codes. */ @@ -148,7 +152,10 @@ public class DataElement extends DomainResource { * added to help the parsers */ NULL; - public static BindingConformance fromCode(String codeString) throws Exception { + + public static final BindingConformanceEnumFactory ENUM_FACTORY = new BindingConformanceEnumFactory(); + + public static BindingConformance fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("required".equals(codeString)) @@ -157,8 +164,9 @@ public class DataElement extends DomainResource { return PREFERRED; if ("example".equals(codeString)) return EXAMPLE; - throw new Exception("Unknown BindingConformance code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUIRED: return "required"; @@ -193,8 +201,8 @@ public class DataElement extends DomainResource { } } - public static class BindingConformanceEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class BindingConformanceEnumFactory implements EnumFactory { + public BindingConformance fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -204,9 +212,9 @@ public class DataElement extends DomainResource { return BindingConformance.PREFERRED; if ("example".equals(codeString)) return BindingConformance.EXAMPLE; - throw new Exception("Unknown BindingConformance code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(BindingConformance code) throws IllegalArgumentException { if (code == BindingConformance.REQUIRED) return "required"; if (code == BindingConformance.PREFERRED) @@ -351,7 +359,7 @@ public class DataElement extends DomainResource { this.conformance = null; else { if (this.conformance == null) - this.conformance = new Enumeration(); + this.conformance = new Enumeration(BindingConformance.ENUM_FACTORY); this.conformance.setValue(value); } return this; @@ -485,28 +493,35 @@ public class DataElement extends DomainResource { @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="A URI that identifies the specification that this mapping is expressed to." ) protected UriType uri; + /** + * If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element. + */ + @Child(name="definitional", type={BooleanType.class}, order=2, min=0, max=1) + @Description(shortDefinition="True if mapping defines element", formalDefinition="If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element." ) + protected BooleanType definitional; + /** * A name for the specification that is being mapped to. */ - @Child(name="name", type={StringType.class}, order=2, min=0, max=1) + @Child(name="name", type={StringType.class}, order=3, min=0, max=1) @Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." ) protected StringType name; /** * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. */ - @Child(name="comments", type={StringType.class}, order=3, min=0, max=1) + @Child(name="comments", type={StringType.class}, order=4, min=0, max=1) @Description(shortDefinition="Versions, Issues, Scope limitations etc", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." ) protected StringType comments; /** * Expresses what part of the target specification corresponds to this element. */ - @Child(name="map", type={StringType.class}, order=4, min=1, max=1) + @Child(name="map", type={StringType.class}, order=5, min=1, max=1) @Description(shortDefinition="Details of the mapping", formalDefinition="Expresses what part of the target specification corresponds to this element." ) protected StringType map; - private static final long serialVersionUID = -229299076L; + private static final long serialVersionUID = 797049346L; public DataElementMappingComponent() { super(); @@ -566,6 +581,55 @@ public class DataElement extends DomainResource { return this; } + /** + * @return {@link #definitional} (If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.). This is the underlying object with id, value and extensions. The accessor "getDefinitional" gives direct access to the value + */ + public BooleanType getDefinitionalElement() { + if (this.definitional == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DataElementMappingComponent.definitional"); + else if (Configuration.doAutoCreate()) + this.definitional = new BooleanType(); + return this.definitional; + } + + public boolean hasDefinitionalElement() { + return this.definitional != null && !this.definitional.isEmpty(); + } + + public boolean hasDefinitional() { + return this.definitional != null && !this.definitional.isEmpty(); + } + + /** + * @param value {@link #definitional} (If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.). This is the underlying object with id, value and extensions. The accessor "getDefinitional" gives direct access to the value + */ + public DataElementMappingComponent setDefinitionalElement(BooleanType value) { + this.definitional = value; + return this; + } + + /** + * @return If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element. + */ + public boolean getDefinitional() { + return this.definitional == null ? false : this.definitional.getValue(); + } + + /** + * @param value If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element. + */ + public DataElementMappingComponent setDefinitional(boolean value) { + if (value == false) + this.definitional = null; + else { + if (this.definitional == null) + this.definitional = new BooleanType(); + this.definitional.setValue(value); + } + return this; + } + /** * @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value */ @@ -712,6 +776,7 @@ public class DataElement extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("uri", "uri", "A URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri)); + childrenList.add(new Property("definitional", "boolean", "If true, indicates that the official meaning of the data element is exactly equivalent to the mapped element.", 0, java.lang.Integer.MAX_VALUE, definitional)); childrenList.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, java.lang.Integer.MAX_VALUE, name)); childrenList.add(new Property("comments", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, java.lang.Integer.MAX_VALUE, comments)); childrenList.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, map)); @@ -721,6 +786,7 @@ public class DataElement extends DomainResource { DataElementMappingComponent dst = new DataElementMappingComponent(); copyValues(dst); dst.uri = uri == null ? null : uri.copy(); + dst.definitional = definitional == null ? null : definitional.copy(); dst.name = name == null ? null : name.copy(); dst.comments = comments == null ? null : comments.copy(); dst.map = map == null ? null : map.copy(); @@ -728,8 +794,9 @@ public class DataElement extends DomainResource { } public boolean isEmpty() { - return super.isEmpty() && (uri == null || uri.isEmpty()) && (name == null || name.isEmpty()) - && (comments == null || comments.isEmpty()) && (map == null || map.isEmpty()); + return super.isEmpty() && (uri == null || uri.isEmpty()) && (definitional == null || definitional.isEmpty()) + && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()) && (map == null || map.isEmpty()) + ; } } @@ -808,7 +875,7 @@ public class DataElement extends DomainResource { * Provides a complete explanation of the meaning of the data element for human readability. */ @Child(name="definition", type={StringType.class}, order=9, min=0, max=1) - @Description(shortDefinition="Full formal definition in human language", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability." ) + @Description(shortDefinition="Definition/description as narrative text", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability." ) protected StringType definition; /** @@ -840,10 +907,10 @@ public class DataElement extends DomainResource { protected CodeType type; /** - * An example value for this element. + * An sample value for this element demonstrating the type of information that would typically be captured. */ @Child(name="example", type={}, order=14, min=0, max=1) - @Description(shortDefinition="Example value: [as defined for type]", formalDefinition="An example value for this element." ) + @Description(shortDefinition="Example value: [as defined for type]", formalDefinition="An sample value for this element demonstrating the type of information that would typically be captured." ) protected org.hl7.fhir.instance.model.Type example; /** @@ -1077,7 +1144,7 @@ public class DataElement extends DomainResource { */ public DataElement setStatus(ResourceObservationDefStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ResourceObservationDefStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1113,14 +1180,14 @@ public class DataElement extends DomainResource { /** * @return The date that this version of the data element was published. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date that this version of the data element was published. */ - public DataElement setDate(DateAndTime value) { + public DataElement setDate(Date value) { if (value == null) this.date = null; else { @@ -1540,7 +1607,7 @@ public class DataElement extends DomainResource { } /** - * @return {@link #example} (An example value for this element.) + * @return {@link #example} (An sample value for this element demonstrating the type of information that would typically be captured.) */ public org.hl7.fhir.instance.model.Type getExample() { return this.example; @@ -1551,7 +1618,7 @@ public class DataElement extends DomainResource { } /** - * @param value {@link #example} (An example value for this element.) + * @param value {@link #example} (An sample value for this element demonstrating the type of information that would typically be captured.) */ public DataElement setExample(org.hl7.fhir.instance.model.Type value) { this.example = value; @@ -1702,7 +1769,7 @@ public class DataElement extends DomainResource { childrenList.add(new Property("requirements", "string", "Explains why this element is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); childrenList.add(new Property("synonym", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, synonym)); childrenList.add(new Property("type", "code", "The FHIR data type that is the type for this element.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("example[x]", "*", "An example value for this element.", 0, java.lang.Integer.MAX_VALUE, example)); + childrenList.add(new Property("example[x]", "*", "An sample value for this element demonstrating the type of information that would typically be captured.", 0, java.lang.Integer.MAX_VALUE, example)); childrenList.add(new Property("maxLength", "integer", "Indicates the shortest length that SHALL be supported by conformant instances without truncation.", 0, java.lang.Integer.MAX_VALUE, maxLength)); childrenList.add(new Property("units", "CodeableConcept", "Identifies the units of measure in which the data element should be captured or expressed.", 0, java.lang.Integer.MAX_VALUE, units)); childrenList.add(new Property("binding", "", "Binds to a value set if this element is coded (code, Coding, CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, binding)); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java index 60e1a077921..7d32e5b9d3b 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateAndTime.java @@ -178,12 +178,12 @@ public class DateAndTime { } else { TimeZone tz; if (!timezone) { - tz = TimeZone.getTimeZone("GMT + 00 : 00"); - } else { + tz = TimeZone.getTimeZone("GMT+00:00"); + } else { tz = TimeZone.getTimeZone("GMT"+(positiveOffset ? "+" : "-")+Utilities.padLeft(java.lang.Integer.toString(tzHour), '0', 2)+":"+Utilities.padLeft(java.lang.Integer.toString(tzMin), '0', 2)); - } + } cal = Calendar.getInstance(tz); - } + } //default to 0 if unset cal.set(Calendar.MONTH, 0); @@ -206,7 +206,7 @@ public class DateAndTime { if (fractions > 0) { cal.set(Calendar.MILLISECOND, (int)((double) fraction / Math.pow(10, fractions) * 1000.0)); } - } + } } } } @@ -332,7 +332,7 @@ public class DateAndTime { positiveOffset = isPositiveOffset; this.timezone = true; } - + /** * @return true if the tz offset is positive (i.e. +06:00), false if the tz offset is negative (-06:00) */ diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java index d0766f4acb5..5a360158df0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateTimeType.java @@ -29,13 +29,13 @@ POSSIBILITY OF SUCH DAMAGE. package org.hl7.fhir.instance.model; +import java.util.Calendar; import java.util.Date; import java.util.TimeZone; +import org.apache.commons.lang3.time.DateUtils; import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import ca.uhn.fhir.parser.DataFormatException; - /** * Represents a FHIR dateTime datatype. Valid precisions values for this type are: *
      @@ -112,6 +112,17 @@ public class DateTimeType extends BaseDateTimeType { super(theDate, thePrecision, theTimezone); } + /** + * Constructor + */ + public DateTimeType(Calendar theCalendar) { + if (theCalendar != null) { + setValue(theCalendar.getTime()); + setPrecision(DEFAULT_PRECISION); + setTimeZone(theCalendar.getTimeZone()); + } + } + @Override boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { switch (thePrecision) { @@ -127,10 +138,10 @@ public class DateTimeType extends BaseDateTimeType { } /** - * Returns a new instance of DateTimeDt with the current system time and SECOND precision and the system local time + * Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time * zone */ - public static DateTimeType withCurrentTime() { + public static DateTimeType now() { return new DateTimeType(new Date(), TemporalPrecisionEnum.SECOND, TimeZone.getDefault()); } @@ -149,4 +160,31 @@ public class DateTimeType extends BaseDateTimeType { return new DateTimeType(getValueAsString()); } + /** + * Creates a new instance by parsing an HL7 v3 format date time string + */ + public static InstantType parseV3(String theV3String) { + InstantType retVal = new InstantType(); + retVal.setValueAsV3String(theV3String); + return retVal; + } + + public static DateTimeType today() { + DateTimeType retVal = now(); + retVal.setPrecision(TemporalPrecisionEnum.DAY); + return retVal; + } + + public boolean getTzSign() { + return getTimeZone().getRawOffset() >= 0; + } + + public int getTzHour() { + return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) / 60; + } + + public int getTzMin() { + return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) % 60; + } + } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateType.java index f3a85913763..f4fcf7259a8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DateType.java @@ -48,6 +48,8 @@ import java.util.Date; @DatatypeDef(name = "date") public class DateType extends BaseDateTimeType { + private static final long serialVersionUID = 1L; + /** * The default precision for this type */ diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DecimalType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DecimalType.java index ca362a20e2c..6d13a6c58cb 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DecimalType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DecimalType.java @@ -43,6 +43,8 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef; @DatatypeDef(name = "decimal") public class DecimalType extends PrimitiveType implements Comparable { + private static final long serialVersionUID = 1L; + /** * Constructor */ @@ -61,7 +63,7 @@ public class DecimalType extends PrimitiveType implements Comparable * Constructor */ public DecimalType(double theValue) { - // Use the valueOf here because the constructor gives crazy precision + // Use the valueOf here because the constructor gives wacky precision // changes due to the floating point conversion setValue(BigDecimal.valueOf(theValue)); } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Device.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Device.java index fa0415c8c47..41c02fdeecb 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Device.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Device.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -394,14 +394,14 @@ public class Device extends DomainResource { /** * @return Date of expiry of this device (if applicable). */ - public DateAndTime getExpiry() { + public Date getExpiry() { return this.expiry == null ? null : this.expiry.getValue(); } /** * @param value Date of expiry of this device (if applicable). */ - public Device setExpiry(DateAndTime value) { + public Device setExpiry(Date value) { if (value == null) this.expiry = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java index bd85850484b..f06f589d8bc 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceComponent.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent") public class DeviceComponent extends DomainResource { - public enum MeasurementPrinciple { + public enum MeasurementPrinciple implements FhirEnum { /** * Measurement principle isn't in the list. */ @@ -94,7 +94,10 @@ public class DeviceComponent extends DomainResource { * added to help the parsers */ NULL; - public static MeasurementPrinciple fromCode(String codeString) throws Exception { + + public static final MeasurementPrincipleEnumFactory ENUM_FACTORY = new MeasurementPrincipleEnumFactory(); + + public static MeasurementPrinciple fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("other".equals(codeString)) @@ -119,8 +122,9 @@ public class DeviceComponent extends DomainResource { return ACOUSTICAL; if ("manual".equals(codeString)) return MANUAL; - throw new Exception("Unknown MeasurementPrinciple code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case OTHER: return "other"; @@ -187,8 +191,8 @@ public class DeviceComponent extends DomainResource { } } - public static class MeasurementPrincipleEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class MeasurementPrincipleEnumFactory implements EnumFactory { + public MeasurementPrinciple fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -214,9 +218,9 @@ public class DeviceComponent extends DomainResource { return MeasurementPrinciple.ACOUSTICAL; if ("manual".equals(codeString)) return MeasurementPrinciple.MANUAL; - throw new Exception("Unknown MeasurementPrinciple code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MeasurementPrinciple code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(MeasurementPrinciple code) throws IllegalArgumentException { if (code == MeasurementPrinciple.OTHER) return "other"; if (code == MeasurementPrinciple.CHEMICAL) @@ -564,14 +568,14 @@ public class DeviceComponent extends DomainResource { /** * @return Describes the timestamp for the most recent system change which includes device configuration or setting change. */ - public DateAndTime getLastSystemChange() { + public Date getLastSystemChange() { return this.lastSystemChange == null ? null : this.lastSystemChange.getValue(); } /** * @param value Describes the timestamp for the most recent system change which includes device configuration or setting change. */ - public DeviceComponent setLastSystemChange(DateAndTime value) { + public DeviceComponent setLastSystemChange(Date value) { if (this.lastSystemChange == null) this.lastSystemChange = new InstantType(); this.lastSystemChange.setValue(value); @@ -763,7 +767,7 @@ public class DeviceComponent extends DomainResource { this.measurementPrinciple = null; else { if (this.measurementPrinciple == null) - this.measurementPrinciple = new Enumeration(); + this.measurementPrinciple = new Enumeration(MeasurementPrinciple.ENUM_FACTORY); this.measurementPrinciple.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java new file mode 100644 index 00000000000..d9b3abe7efa --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceMetric.java @@ -0,0 +1,1185 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * Describes a measurement, calculation or setting capability of a medical device. + */ +@ResourceDef(name="DeviceMetric", profile="http://hl7.org/fhir/Profile/DeviceMetric") +public class DeviceMetric extends Resource { + + public enum MetricOperationalStatus implements FhirEnum { + /** + * The DeviceMetric is operating and will generate DeviceObservations. + */ + ON, + /** + * The DeviceMetric is not operating. + */ + OFF, + /** + * The DeviceMetric is operating, but will not generate any DeviceObservations. + */ + STANDBY, + /** + * added to help the parsers + */ + NULL; + + public static final MetricOperationalStatusEnumFactory ENUM_FACTORY = new MetricOperationalStatusEnumFactory(); + + public static MetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("on".equals(codeString)) + return ON; + if ("off".equals(codeString)) + return OFF; + if ("standby".equals(codeString)) + return STANDBY; + throw new IllegalArgumentException("Unknown MetricOperationalStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case ON: return "on"; + case OFF: return "off"; + case STANDBY: return "standby"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case ON: return ""; + case OFF: return ""; + case STANDBY: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case ON: return "The DeviceMetric is operating and will generate DeviceObservations."; + case OFF: return "The DeviceMetric is not operating."; + case STANDBY: return "The DeviceMetric is operating, but will not generate any DeviceObservations."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case ON: return "on"; + case OFF: return "off"; + case STANDBY: return "standby"; + default: return "?"; + } + } + } + + public static class MetricOperationalStatusEnumFactory implements EnumFactory { + public MetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("on".equals(codeString)) + return MetricOperationalStatus.ON; + if ("off".equals(codeString)) + return MetricOperationalStatus.OFF; + if ("standby".equals(codeString)) + return MetricOperationalStatus.STANDBY; + throw new IllegalArgumentException("Unknown MetricOperationalStatus code '"+codeString+"'"); + } + public String toCode(MetricOperationalStatus code) throws IllegalArgumentException { + if (code == MetricOperationalStatus.ON) + return "on"; + if (code == MetricOperationalStatus.OFF) + return "off"; + if (code == MetricOperationalStatus.STANDBY) + return "standby"; + return "?"; + } + } + + public enum MetricCategory implements FhirEnum { + /** + * DeviceObservations generated for this DeviceMetric are measured. + */ + MEASUREMENT, + /** + * DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device. + */ + SETTING, + /** + * DeviceObservations generated for this DeviceMetric are calculated. + */ + CALCULATION, + /** + * The category of this DeviceMetric is unspecified. + */ + UNSPECIFIED, + /** + * added to help the parsers + */ + NULL; + + public static final MetricCategoryEnumFactory ENUM_FACTORY = new MetricCategoryEnumFactory(); + + public static MetricCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("measurement".equals(codeString)) + return MEASUREMENT; + if ("setting".equals(codeString)) + return SETTING; + if ("calculation".equals(codeString)) + return CALCULATION; + if ("unspecified".equals(codeString)) + return UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCategory code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case MEASUREMENT: return "measurement"; + case SETTING: return "setting"; + case CALCULATION: return "calculation"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MEASUREMENT: return ""; + case SETTING: return ""; + case CALCULATION: return ""; + case UNSPECIFIED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MEASUREMENT: return "DeviceObservations generated for this DeviceMetric are measured."; + case SETTING: return "DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device."; + case CALCULATION: return "DeviceObservations generated for this DeviceMetric are calculated."; + case UNSPECIFIED: return "The category of this DeviceMetric is unspecified."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MEASUREMENT: return "measurement"; + case SETTING: return "setting"; + case CALCULATION: return "calculation"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + } + + public static class MetricCategoryEnumFactory implements EnumFactory { + public MetricCategory fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("measurement".equals(codeString)) + return MetricCategory.MEASUREMENT; + if ("setting".equals(codeString)) + return MetricCategory.SETTING; + if ("calculation".equals(codeString)) + return MetricCategory.CALCULATION; + if ("unspecified".equals(codeString)) + return MetricCategory.UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCategory code '"+codeString+"'"); + } + public String toCode(MetricCategory code) throws IllegalArgumentException { + if (code == MetricCategory.MEASUREMENT) + return "measurement"; + if (code == MetricCategory.SETTING) + return "setting"; + if (code == MetricCategory.CALCULATION) + return "calculation"; + if (code == MetricCategory.UNSPECIFIED) + return "unspecified"; + return "?"; + } + } + + public enum MetricCalibrationType implements FhirEnum { + /** + * TODO. + */ + UNSPECIFIED, + /** + * TODO. + */ + OFFSET, + /** + * TODO. + */ + GAIN, + /** + * TODO. + */ + TWOPOINT, + /** + * added to help the parsers + */ + NULL; + + public static final MetricCalibrationTypeEnumFactory ENUM_FACTORY = new MetricCalibrationTypeEnumFactory(); + + public static MetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("unspecified".equals(codeString)) + return UNSPECIFIED; + if ("offset".equals(codeString)) + return OFFSET; + if ("gain".equals(codeString)) + return GAIN; + if ("two-point".equals(codeString)) + return TWOPOINT; + throw new IllegalArgumentException("Unknown MetricCalibrationType code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case UNSPECIFIED: return "unspecified"; + case OFFSET: return "offset"; + case GAIN: return "gain"; + case TWOPOINT: return "two-point"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case UNSPECIFIED: return ""; + case OFFSET: return ""; + case GAIN: return ""; + case TWOPOINT: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case UNSPECIFIED: return "TODO."; + case OFFSET: return "TODO."; + case GAIN: return "TODO."; + case TWOPOINT: return "TODO."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case UNSPECIFIED: return "unspecified"; + case OFFSET: return "offset"; + case GAIN: return "gain"; + case TWOPOINT: return "two-point"; + default: return "?"; + } + } + } + + public static class MetricCalibrationTypeEnumFactory implements EnumFactory { + public MetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("unspecified".equals(codeString)) + return MetricCalibrationType.UNSPECIFIED; + if ("offset".equals(codeString)) + return MetricCalibrationType.OFFSET; + if ("gain".equals(codeString)) + return MetricCalibrationType.GAIN; + if ("two-point".equals(codeString)) + return MetricCalibrationType.TWOPOINT; + throw new IllegalArgumentException("Unknown MetricCalibrationType code '"+codeString+"'"); + } + public String toCode(MetricCalibrationType code) throws IllegalArgumentException { + if (code == MetricCalibrationType.UNSPECIFIED) + return "unspecified"; + if (code == MetricCalibrationType.OFFSET) + return "offset"; + if (code == MetricCalibrationType.GAIN) + return "gain"; + if (code == MetricCalibrationType.TWOPOINT) + return "two-point"; + return "?"; + } + } + + public enum MetricCalibrationState implements FhirEnum { + /** + * The metric has not been calibrated. + */ + NOTCALIBRATED, + /** + * The metric needs to be calibrated. + */ + CALIBRATIONREQUIRED, + /** + * The metric has been calibrated. + */ + CALIBRATED, + /** + * The state of calibration of this metric is unspecified. + */ + UNSPECIFIED, + /** + * added to help the parsers + */ + NULL; + + public static final MetricCalibrationStateEnumFactory ENUM_FACTORY = new MetricCalibrationStateEnumFactory(); + + public static MetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("not-calibrated".equals(codeString)) + return NOTCALIBRATED; + if ("calibration-required".equals(codeString)) + return CALIBRATIONREQUIRED; + if ("calibrated".equals(codeString)) + return CALIBRATED; + if ("unspecified".equals(codeString)) + return UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCalibrationState code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case NOTCALIBRATED: return "not-calibrated"; + case CALIBRATIONREQUIRED: return "calibration-required"; + case CALIBRATED: return "calibrated"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case NOTCALIBRATED: return ""; + case CALIBRATIONREQUIRED: return ""; + case CALIBRATED: return ""; + case UNSPECIFIED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case NOTCALIBRATED: return "The metric has not been calibrated."; + case CALIBRATIONREQUIRED: return "The metric needs to be calibrated."; + case CALIBRATED: return "The metric has been calibrated."; + case UNSPECIFIED: return "The state of calibration of this metric is unspecified."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case NOTCALIBRATED: return "not-calibrated"; + case CALIBRATIONREQUIRED: return "calibration-required"; + case CALIBRATED: return "calibrated"; + case UNSPECIFIED: return "unspecified"; + default: return "?"; + } + } + } + + public static class MetricCalibrationStateEnumFactory implements EnumFactory { + public MetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("not-calibrated".equals(codeString)) + return MetricCalibrationState.NOTCALIBRATED; + if ("calibration-required".equals(codeString)) + return MetricCalibrationState.CALIBRATIONREQUIRED; + if ("calibrated".equals(codeString)) + return MetricCalibrationState.CALIBRATED; + if ("unspecified".equals(codeString)) + return MetricCalibrationState.UNSPECIFIED; + throw new IllegalArgumentException("Unknown MetricCalibrationState code '"+codeString+"'"); + } + public String toCode(MetricCalibrationState code) throws IllegalArgumentException { + if (code == MetricCalibrationState.NOTCALIBRATED) + return "not-calibrated"; + if (code == MetricCalibrationState.CALIBRATIONREQUIRED) + return "calibration-required"; + if (code == MetricCalibrationState.CALIBRATED) + return "calibrated"; + if (code == MetricCalibrationState.UNSPECIFIED) + return "unspecified"; + return "?"; + } + } + + @Block() + public static class DeviceMetricCalibrationInfoComponent extends BackboneElement { + /** + * Describes the type of the calibration method. + */ + @Child(name="type", type={CodeType.class}, order=1, min=0, max=1) + @Description(shortDefinition="unspecified | offset | gain | two-point", formalDefinition="Describes the type of the calibration method." ) + protected Enumeration type; + + /** + * Describes the state of the calibration. + */ + @Child(name="state", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="not-calibrated | calibration-required | calibrated | unspecified", formalDefinition="Describes the state of the calibration." ) + protected Enumeration state; + + /** + * Describes the time last calibration has been performed. + */ + @Child(name="time", type={InstantType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Describes the time last calibration has been performed", formalDefinition="Describes the time last calibration has been performed." ) + protected InstantType time; + + private static final long serialVersionUID = 407720126L; + + public DeviceMetricCalibrationInfoComponent() { + super(); + } + + /** + * @return {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public Enumeration getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetricCalibrationInfoComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Enumeration(); + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public DeviceMetricCalibrationInfoComponent setTypeElement(Enumeration value) { + this.type = value; + return this; + } + + /** + * @return Describes the type of the calibration method. + */ + public MetricCalibrationType getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value Describes the type of the calibration method. + */ + public DeviceMetricCalibrationInfoComponent setType(MetricCalibrationType value) { + if (value == null) + this.type = null; + else { + if (this.type == null) + this.type = new Enumeration(MetricCalibrationType.ENUM_FACTORY); + this.type.setValue(value); + } + return this; + } + + /** + * @return {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public Enumeration getStateElement() { + if (this.state == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetricCalibrationInfoComponent.state"); + else if (Configuration.doAutoCreate()) + this.state = new Enumeration(); + return this.state; + } + + public boolean hasStateElement() { + return this.state != null && !this.state.isEmpty(); + } + + public boolean hasState() { + return this.state != null && !this.state.isEmpty(); + } + + /** + * @param value {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value + */ + public DeviceMetricCalibrationInfoComponent setStateElement(Enumeration value) { + this.state = value; + return this; + } + + /** + * @return Describes the state of the calibration. + */ + public MetricCalibrationState getState() { + return this.state == null ? null : this.state.getValue(); + } + + /** + * @param value Describes the state of the calibration. + */ + public DeviceMetricCalibrationInfoComponent setState(MetricCalibrationState value) { + if (value == null) + this.state = null; + else { + if (this.state == null) + this.state = new Enumeration(MetricCalibrationState.ENUM_FACTORY); + this.state.setValue(value); + } + return this; + } + + /** + * @return {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public InstantType getTimeElement() { + if (this.time == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetricCalibrationInfoComponent.time"); + else if (Configuration.doAutoCreate()) + this.time = new InstantType(); + return this.time; + } + + public boolean hasTimeElement() { + return this.time != null && !this.time.isEmpty(); + } + + public boolean hasTime() { + return this.time != null && !this.time.isEmpty(); + } + + /** + * @param value {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value + */ + public DeviceMetricCalibrationInfoComponent setTimeElement(InstantType value) { + this.time = value; + return this; + } + + /** + * @return Describes the time last calibration has been performed. + */ + public Date getTime() { + return this.time == null ? null : this.time.getValue(); + } + + /** + * @param value Describes the time last calibration has been performed. + */ + public DeviceMetricCalibrationInfoComponent setTime(Date value) { + if (value == null) + this.time = null; + else { + if (this.time == null) + this.time = new InstantType(); + this.time.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "code", "Describes the type of the calibration method.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("state", "code", "Describes the state of the calibration.", 0, java.lang.Integer.MAX_VALUE, state)); + childrenList.add(new Property("time", "instant", "Describes the time last calibration has been performed.", 0, java.lang.Integer.MAX_VALUE, time)); + } + + public DeviceMetricCalibrationInfoComponent copy() { + DeviceMetricCalibrationInfoComponent dst = new DeviceMetricCalibrationInfoComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.state = state == null ? null : state.copy(); + dst.time = time == null ? null : time.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (state == null || state.isEmpty()) + && (time == null || time.isEmpty()); + } + + } + + /** + * Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. + */ + @Child(name="type", type={CodeableConcept.class}, order=-1, min=1, max=1) + @Description(shortDefinition="Type of metric", formalDefinition="Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc." ) + protected CodeableConcept type; + + /** + * Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device. + */ + @Child(name="identifier", type={Identifier.class}, order=0, min=1, max=1) + @Description(shortDefinition="Unique identifier of this DeviceMetric", formalDefinition="Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device." ) + protected Identifier identifier; + + /** + * Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc. + */ + @Child(name="unit", type={CodeableConcept.class}, order=1, min=0, max=1) + @Description(shortDefinition="Unit of metric", formalDefinition="Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc." ) + protected CodeableConcept unit; + + /** + * Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc. + */ + @Child(name="source", type={Device.class}, order=2, min=0, max=1) + @Description(shortDefinition="Describes the link to the source Device", formalDefinition="Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc." ) + protected Reference source; + + /** + * The actual object that is the target of the reference (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + protected Device sourceTarget; + + /** + * Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location. + */ + @Child(name="parent", type={DeviceComponent.class}, order=3, min=0, max=1) + @Description(shortDefinition="Describes the link to the parent DeviceComponent", formalDefinition="Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location." ) + protected Reference parent; + + /** + * The actual object that is the target of the reference (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + protected DeviceComponent parentTarget; + + /** + * Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + @Child(name="operationalState", type={CodeType.class}, order=4, min=0, max=1) + @Description(shortDefinition="on | off | standby", formalDefinition="Indicates current operational state of the device. For example: On, Off, Standby, etc." ) + protected Enumeration operationalState; + + /** + * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + */ + @Child(name="measurementMode", type={Identifier.class}, order=5, min=0, max=1) + @Description(shortDefinition="Describes the physical principle of the measurement", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) + protected Identifier measurementMode; + + /** + * Describes the typical color of the representation of observations that have been generated for this DeviceMetric. + */ + @Child(name="color", type={Identifier.class}, order=6, min=0, max=1) + @Description(shortDefinition="Describes the typical color of representation", formalDefinition="Describes the typical color of the representation of observations that have been generated for this DeviceMetric." ) + protected Identifier color; + + /** + * Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + */ + @Child(name="category", type={CodeType.class}, order=7, min=1, max=1) + @Description(shortDefinition="measurement | setting | calculation | unspecified", formalDefinition="Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation." ) + protected Enumeration category; + + /** + * Describes the measurement repetition time. This is not +necessarily the same as the update +period. + */ + @Child(name="measurementPeriod", type={Timing.class}, order=8, min=0, max=1) + @Description(shortDefinition="Describes the measurement repetition time", formalDefinition="Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod." ) + protected Timing measurementPeriod; + + /** + * Describes the calibrations that have been performed or that are required to be performed. + */ + @Child(name="calibrationInfo", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Describes the calibrations that have been performed or that are required to be performed", formalDefinition="Describes the calibrations that have been performed or that are required to be performed." ) + protected List calibrationInfo; + + private static final long serialVersionUID = 600373390L; + + public DeviceMetric() { + super(); + } + + public DeviceMetric(CodeableConcept type, Identifier identifier, Enumeration category) { + super(); + this.type = type; + this.identifier = identifier; + this.category = category; + } + + /** + * @return {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) + */ + public CodeableConcept getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) + */ + public DeviceMetric setType(CodeableConcept value) { + this.type = value; + return this; + } + + /** + * @return {@link #identifier} (Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) + */ + public Identifier getIdentifier() { + if (this.identifier == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.identifier"); + else if (Configuration.doAutoCreate()) + this.identifier = new Identifier(); + return this.identifier; + } + + public boolean hasIdentifier() { + return this.identifier != null && !this.identifier.isEmpty(); + } + + /** + * @param value {@link #identifier} (Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) + */ + public DeviceMetric setIdentifier(Identifier value) { + this.identifier = value; + return this; + } + + /** + * @return {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) + */ + public CodeableConcept getUnit() { + if (this.unit == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.unit"); + else if (Configuration.doAutoCreate()) + this.unit = new CodeableConcept(); + return this.unit; + } + + public boolean hasUnit() { + return this.unit != null && !this.unit.isEmpty(); + } + + /** + * @param value {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) + */ + public DeviceMetric setUnit(CodeableConcept value) { + this.unit = value; + return this; + } + + /** + * @return {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public Reference getSource() { + if (this.source == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.source"); + else if (Configuration.doAutoCreate()) + this.source = new Reference(); + return this.source; + } + + public boolean hasSource() { + return this.source != null && !this.source.isEmpty(); + } + + /** + * @param value {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceMetric setSource(Reference value) { + this.source = value; + return this; + } + + /** + * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public Device getSourceTarget() { + if (this.sourceTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.source"); + else if (Configuration.doAutoCreate()) + this.sourceTarget = new Device(); + return this.sourceTarget; + } + + /** + * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) + */ + public DeviceMetric setSourceTarget(Device value) { + this.sourceTarget = value; + return this; + } + + /** + * @return {@link #parent} (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public Reference getParent() { + if (this.parent == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.parent"); + else if (Configuration.doAutoCreate()) + this.parent = new Reference(); + return this.parent; + } + + public boolean hasParent() { + return this.parent != null && !this.parent.isEmpty(); + } + + /** + * @param value {@link #parent} (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public DeviceMetric setParent(Reference value) { + this.parent = value; + return this; + } + + /** + * @return {@link #parent} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public DeviceComponent getParentTarget() { + if (this.parentTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.parent"); + else if (Configuration.doAutoCreate()) + this.parentTarget = new DeviceComponent(); + return this.parentTarget; + } + + /** + * @param value {@link #parent} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) + */ + public DeviceMetric setParentTarget(DeviceComponent value) { + this.parentTarget = value; + return this; + } + + /** + * @return {@link #operationalState} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalState" gives direct access to the value + */ + public Enumeration getOperationalStateElement() { + if (this.operationalState == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.operationalState"); + else if (Configuration.doAutoCreate()) + this.operationalState = new Enumeration(); + return this.operationalState; + } + + public boolean hasOperationalStateElement() { + return this.operationalState != null && !this.operationalState.isEmpty(); + } + + public boolean hasOperationalState() { + return this.operationalState != null && !this.operationalState.isEmpty(); + } + + /** + * @param value {@link #operationalState} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalState" gives direct access to the value + */ + public DeviceMetric setOperationalStateElement(Enumeration value) { + this.operationalState = value; + return this; + } + + /** + * @return Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + public MetricOperationalStatus getOperationalState() { + return this.operationalState == null ? null : this.operationalState.getValue(); + } + + /** + * @param value Indicates current operational state of the device. For example: On, Off, Standby, etc. + */ + public DeviceMetric setOperationalState(MetricOperationalStatus value) { + if (value == null) + this.operationalState = null; + else { + if (this.operationalState == null) + this.operationalState = new Enumeration(MetricOperationalStatus.ENUM_FACTORY); + this.operationalState.setValue(value); + } + return this; + } + + /** + * @return {@link #measurementMode} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.) + */ + public Identifier getMeasurementMode() { + if (this.measurementMode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.measurementMode"); + else if (Configuration.doAutoCreate()) + this.measurementMode = new Identifier(); + return this.measurementMode; + } + + public boolean hasMeasurementMode() { + return this.measurementMode != null && !this.measurementMode.isEmpty(); + } + + /** + * @param value {@link #measurementMode} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.) + */ + public DeviceMetric setMeasurementMode(Identifier value) { + this.measurementMode = value; + return this; + } + + /** + * @return {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.) + */ + public Identifier getColor() { + if (this.color == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.color"); + else if (Configuration.doAutoCreate()) + this.color = new Identifier(); + return this.color; + } + + public boolean hasColor() { + return this.color != null && !this.color.isEmpty(); + } + + /** + * @param value {@link #color} (Describes the typical color of the representation of observations that have been generated for this DeviceMetric.) + */ + public DeviceMetric setColor(Identifier value) { + this.color = value; + return this; + } + + /** + * @return {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public Enumeration getCategoryElement() { + if (this.category == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.category"); + else if (Configuration.doAutoCreate()) + this.category = new Enumeration(); + return this.category; + } + + public boolean hasCategoryElement() { + return this.category != null && !this.category.isEmpty(); + } + + public boolean hasCategory() { + return this.category != null && !this.category.isEmpty(); + } + + /** + * @param value {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value + */ + public DeviceMetric setCategoryElement(Enumeration value) { + this.category = value; + return this; + } + + /** + * @return Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + */ + public MetricCategory getCategory() { + return this.category == null ? null : this.category.getValue(); + } + + /** + * @param value Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + */ + public DeviceMetric setCategory(MetricCategory value) { + if (this.category == null) + this.category = new Enumeration(MetricCategory.ENUM_FACTORY); + this.category.setValue(value); + return this; + } + + /** + * @return {@link #measurementPeriod} (Describes the measurement repetition time. This is not +necessarily the same as the update +period.) + */ + public Timing getMeasurementPeriod() { + if (this.measurementPeriod == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DeviceMetric.measurementPeriod"); + else if (Configuration.doAutoCreate()) + this.measurementPeriod = new Timing(); + return this.measurementPeriod; + } + + public boolean hasMeasurementPeriod() { + return this.measurementPeriod != null && !this.measurementPeriod.isEmpty(); + } + + /** + * @param value {@link #measurementPeriod} (Describes the measurement repetition time. This is not +necessarily the same as the update +period.) + */ + public DeviceMetric setMeasurementPeriod(Timing value) { + this.measurementPeriod = value; + return this; + } + + /** + * @return {@link #calibrationInfo} (Describes the calibrations that have been performed or that are required to be performed.) + */ + public List getCalibrationInfo() { + if (this.calibrationInfo == null) + this.calibrationInfo = new ArrayList(); + return this.calibrationInfo; + } + + public boolean hasCalibrationInfo() { + if (this.calibrationInfo == null) + return false; + for (DeviceMetricCalibrationInfoComponent item : this.calibrationInfo) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #calibrationInfo} (Describes the calibrations that have been performed or that are required to be performed.) + */ + // syntactic sugar + public DeviceMetricCalibrationInfoComponent addCalibrationInfo() { //3 + DeviceMetricCalibrationInfoComponent t = new DeviceMetricCalibrationInfoComponent(); + if (this.calibrationInfo == null) + this.calibrationInfo = new ArrayList(); + this.calibrationInfo.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "CodeableConcept", "Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("identifier", "Identifier", "Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. \nIt should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("unit", "CodeableConcept", "Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.", 0, java.lang.Integer.MAX_VALUE, unit)); + childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); + childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device.\nAn example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.", 0, java.lang.Integer.MAX_VALUE, parent)); + childrenList.add(new Property("operationalState", "code", "Indicates current operational state of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalState)); + childrenList.add(new Property("measurementMode", "Identifier", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementMode)); + childrenList.add(new Property("color", "Identifier", "Describes the typical color of the representation of observations that have been generated for this DeviceMetric.", 0, java.lang.Integer.MAX_VALUE, color)); + childrenList.add(new Property("category", "code", "Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.", 0, java.lang.Integer.MAX_VALUE, category)); + childrenList.add(new Property("measurementPeriod", "Timing", "Describes the measurement repetition time. This is not\nnecessarily the same as the update\nperiod.", 0, java.lang.Integer.MAX_VALUE, measurementPeriod)); + childrenList.add(new Property("calibrationInfo", "", "Describes the calibrations that have been performed or that are required to be performed.", 0, java.lang.Integer.MAX_VALUE, calibrationInfo)); + } + + public DeviceMetric copy() { + DeviceMetric dst = new DeviceMetric(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.identifier = identifier == null ? null : identifier.copy(); + dst.unit = unit == null ? null : unit.copy(); + dst.source = source == null ? null : source.copy(); + dst.parent = parent == null ? null : parent.copy(); + dst.operationalState = operationalState == null ? null : operationalState.copy(); + dst.measurementMode = measurementMode == null ? null : measurementMode.copy(); + dst.color = color == null ? null : color.copy(); + dst.category = category == null ? null : category.copy(); + dst.measurementPeriod = measurementPeriod == null ? null : measurementPeriod.copy(); + if (calibrationInfo != null) { + dst.calibrationInfo = new ArrayList(); + for (DeviceMetricCalibrationInfoComponent i : calibrationInfo) + dst.calibrationInfo.add(i.copy()); + }; + return dst; + } + + protected DeviceMetric typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) + && (unit == null || unit.isEmpty()) && (source == null || source.isEmpty()) && (parent == null || parent.isEmpty()) + && (operationalState == null || operationalState.isEmpty()) && (measurementMode == null || measurementMode.isEmpty()) + && (color == null || color.isEmpty()) && (category == null || category.isEmpty()) && (measurementPeriod == null || measurementPeriod.isEmpty()) + && (calibrationInfo == null || calibrationInfo.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.DeviceMetric; + } + + @SearchParamDefinition(name="category", path="DeviceMetric.category", description="The category of the metric", type="token" ) + public static final String SP_CATEGORY = "category"; + @SearchParamDefinition(name="source", path="DeviceMetric.source", description="The device resource", type="reference" ) + public static final String SP_SOURCE = "source"; + @SearchParamDefinition(name="parent", path="DeviceMetric.parent", description="The parent DeviceMetric resource", type="reference" ) + public static final String SP_PARENT = "parent"; + @SearchParamDefinition(name="type", path="DeviceMetric.type", description="The component type", type="token" ) + public static final String SP_TYPE = "type"; + @SearchParamDefinition(name="identifier", path="DeviceMetric.identifier", description="The identifier of the metric", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java index 2062ff659bc..b9d261d540d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="DeviceUseRequest", profile="http://hl7.org/fhir/Profile/DeviceUseRequest") public class DeviceUseRequest extends DomainResource { - public enum DeviceUseRequestStatus { + public enum DeviceUseRequestStatus implements FhirEnum { /** * The request has been placed. */ @@ -86,7 +86,10 @@ public class DeviceUseRequest extends DomainResource { * added to help the parsers */ NULL; - public static DeviceUseRequestStatus fromCode(String codeString) throws Exception { + + public static final DeviceUseRequestStatusEnumFactory ENUM_FACTORY = new DeviceUseRequestStatusEnumFactory(); + + public static DeviceUseRequestStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("requested".equals(codeString)) @@ -107,8 +110,9 @@ public class DeviceUseRequest extends DomainResource { return REJECTED; if ("failed".equals(codeString)) return FAILED; - throw new Exception("Unknown DeviceUseRequestStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUESTED: return "requested"; @@ -167,8 +171,8 @@ public class DeviceUseRequest extends DomainResource { } } - public static class DeviceUseRequestStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DeviceUseRequestStatusEnumFactory implements EnumFactory { + public DeviceUseRequestStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -190,9 +194,9 @@ public class DeviceUseRequest extends DomainResource { return DeviceUseRequestStatus.REJECTED; if ("failed".equals(codeString)) return DeviceUseRequestStatus.FAILED; - throw new Exception("Unknown DeviceUseRequestStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DeviceUseRequestStatus code) throws IllegalArgumentException { if (code == DeviceUseRequestStatus.REQUESTED) return "requested"; if (code == DeviceUseRequestStatus.RECEIVED) @@ -215,7 +219,7 @@ public class DeviceUseRequest extends DomainResource { } } - public enum DeviceUseRequestMode { + public enum DeviceUseRequestMode implements FhirEnum { /** * planned. */ @@ -232,7 +236,10 @@ public class DeviceUseRequest extends DomainResource { * added to help the parsers */ NULL; - public static DeviceUseRequestMode fromCode(String codeString) throws Exception { + + public static final DeviceUseRequestModeEnumFactory ENUM_FACTORY = new DeviceUseRequestModeEnumFactory(); + + public static DeviceUseRequestMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("planned".equals(codeString)) @@ -241,8 +248,9 @@ public class DeviceUseRequest extends DomainResource { return PROPOSED; if ("ordered".equals(codeString)) return ORDERED; - throw new Exception("Unknown DeviceUseRequestMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DeviceUseRequestMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PLANNED: return "planned"; @@ -277,8 +285,8 @@ public class DeviceUseRequest extends DomainResource { } } - public static class DeviceUseRequestModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DeviceUseRequestModeEnumFactory implements EnumFactory { + public DeviceUseRequestMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -288,9 +296,9 @@ public class DeviceUseRequest extends DomainResource { return DeviceUseRequestMode.PROPOSED; if ("ordered".equals(codeString)) return DeviceUseRequestMode.ORDERED; - throw new Exception("Unknown DeviceUseRequestMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DeviceUseRequestMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DeviceUseRequestMode code) throws IllegalArgumentException { if (code == DeviceUseRequestMode.PLANNED) return "planned"; if (code == DeviceUseRequestMode.PROPOSED) @@ -301,7 +309,7 @@ public class DeviceUseRequest extends DomainResource { } } - public enum DeviceUseRequestPriority { + public enum DeviceUseRequestPriority implements FhirEnum { /** * The request has a normal priority. */ @@ -322,7 +330,10 @@ public class DeviceUseRequest extends DomainResource { * added to help the parsers */ NULL; - public static DeviceUseRequestPriority fromCode(String codeString) throws Exception { + + public static final DeviceUseRequestPriorityEnumFactory ENUM_FACTORY = new DeviceUseRequestPriorityEnumFactory(); + + public static DeviceUseRequestPriority fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("routine".equals(codeString)) @@ -333,8 +344,9 @@ public class DeviceUseRequest extends DomainResource { return STAT; if ("asap".equals(codeString)) return ASAP; - throw new Exception("Unknown DeviceUseRequestPriority code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ROUTINE: return "routine"; @@ -373,8 +385,8 @@ public class DeviceUseRequest extends DomainResource { } } - public static class DeviceUseRequestPriorityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DeviceUseRequestPriorityEnumFactory implements EnumFactory { + public DeviceUseRequestPriority fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -386,9 +398,9 @@ public class DeviceUseRequest extends DomainResource { return DeviceUseRequestPriority.STAT; if ("asap".equals(codeString)) return DeviceUseRequestPriority.ASAP; - throw new Exception("Unknown DeviceUseRequestPriority code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DeviceUseRequestPriority code) throws IllegalArgumentException { if (code == DeviceUseRequestPriority.ROUTINE) return "routine"; if (code == DeviceUseRequestPriority.URGENT) @@ -599,7 +611,7 @@ public class DeviceUseRequest extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(DeviceUseRequestStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -648,7 +660,7 @@ public class DeviceUseRequest extends DomainResource { this.mode = null; else { if (this.mode == null) - this.mode = new Enumeration(); + this.mode = new Enumeration(DeviceUseRequestMode.ENUM_FACTORY); this.mode.setValue(value); } return this; @@ -917,14 +929,14 @@ public class DeviceUseRequest extends DomainResource { /** * @return The time when the request was made. */ - public DateAndTime getOrderedOn() { + public Date getOrderedOn() { return this.orderedOn == null ? null : this.orderedOn.getValue(); } /** * @param value The time when the request was made. */ - public DeviceUseRequest setOrderedOn(DateAndTime value) { + public DeviceUseRequest setOrderedOn(Date value) { if (value == null) this.orderedOn = null; else { @@ -966,14 +978,14 @@ public class DeviceUseRequest extends DomainResource { /** * @return The time at which the request was made/recorded. */ - public DateAndTime getRecordedOn() { + public Date getRecordedOn() { return this.recordedOn == null ? null : this.recordedOn.getValue(); } /** * @param value The time at which the request was made/recorded. */ - public DeviceUseRequest setRecordedOn(DateAndTime value) { + public DeviceUseRequest setRecordedOn(Date value) { if (value == null) this.recordedOn = null; else { @@ -1117,7 +1129,7 @@ public class DeviceUseRequest extends DomainResource { this.priority = null; else { if (this.priority == null) - this.priority = new Enumeration(); + this.priority = new Enumeration(DeviceUseRequestPriority.ENUM_FACTORY); this.priority.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java index be3cb5a5acc..b7b8e2c638d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DeviceUseStatement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -373,14 +373,14 @@ public class DeviceUseStatement extends DomainResource { /** * @return The time at which the statement was made/recorded. */ - public DateAndTime getRecordedOn() { + public Date getRecordedOn() { return this.recordedOn == null ? null : this.recordedOn.getValue(); } /** * @param value The time at which the statement was made/recorded. */ - public DeviceUseStatement setRecordedOn(DateAndTime value) { + public DeviceUseStatement setRecordedOn(Date value) { if (value == null) this.recordedOn = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java index 331dcb16bb7..d417c9d495c 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticOrder.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/Profile/DiagnosticOrder") public class DiagnosticOrder extends DomainResource { - public enum DiagnosticOrderStatus { + public enum DiagnosticOrderStatus implements FhirEnum { /** * The request has been placed. */ @@ -86,7 +86,10 @@ public class DiagnosticOrder extends DomainResource { * added to help the parsers */ NULL; - public static DiagnosticOrderStatus fromCode(String codeString) throws Exception { + + public static final DiagnosticOrderStatusEnumFactory ENUM_FACTORY = new DiagnosticOrderStatusEnumFactory(); + + public static DiagnosticOrderStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("requested".equals(codeString)) @@ -107,8 +110,9 @@ public class DiagnosticOrder extends DomainResource { return REJECTED; if ("failed".equals(codeString)) return FAILED; - throw new Exception("Unknown DiagnosticOrderStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUESTED: return "requested"; @@ -167,8 +171,8 @@ public class DiagnosticOrder extends DomainResource { } } - public static class DiagnosticOrderStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DiagnosticOrderStatusEnumFactory implements EnumFactory { + public DiagnosticOrderStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -190,9 +194,9 @@ public class DiagnosticOrder extends DomainResource { return DiagnosticOrderStatus.REJECTED; if ("failed".equals(codeString)) return DiagnosticOrderStatus.FAILED; - throw new Exception("Unknown DiagnosticOrderStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DiagnosticOrderStatus code) throws IllegalArgumentException { if (code == DiagnosticOrderStatus.REQUESTED) return "requested"; if (code == DiagnosticOrderStatus.RECEIVED) @@ -215,7 +219,7 @@ public class DiagnosticOrder extends DomainResource { } } - public enum DiagnosticOrderPriority { + public enum DiagnosticOrderPriority implements FhirEnum { /** * The order has a normal priority. */ @@ -236,7 +240,10 @@ public class DiagnosticOrder extends DomainResource { * added to help the parsers */ NULL; - public static DiagnosticOrderPriority fromCode(String codeString) throws Exception { + + public static final DiagnosticOrderPriorityEnumFactory ENUM_FACTORY = new DiagnosticOrderPriorityEnumFactory(); + + public static DiagnosticOrderPriority fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("routine".equals(codeString)) @@ -247,8 +254,9 @@ public class DiagnosticOrder extends DomainResource { return STAT; if ("asap".equals(codeString)) return ASAP; - throw new Exception("Unknown DiagnosticOrderPriority code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ROUTINE: return "routine"; @@ -287,8 +295,8 @@ public class DiagnosticOrder extends DomainResource { } } - public static class DiagnosticOrderPriorityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DiagnosticOrderPriorityEnumFactory implements EnumFactory { + public DiagnosticOrderPriority fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -300,9 +308,9 @@ public class DiagnosticOrder extends DomainResource { return DiagnosticOrderPriority.STAT; if ("asap".equals(codeString)) return DiagnosticOrderPriority.ASAP; - throw new Exception("Unknown DiagnosticOrderPriority code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DiagnosticOrderPriority code) throws IllegalArgumentException { if (code == DiagnosticOrderPriority.ROUTINE) return "routine"; if (code == DiagnosticOrderPriority.URGENT) @@ -402,7 +410,7 @@ public class DiagnosticOrder extends DomainResource { */ public DiagnosticOrderEventComponent setStatus(DiagnosticOrderStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(DiagnosticOrderStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -462,14 +470,14 @@ public class DiagnosticOrder extends DomainResource { /** * @return The date/time at which the event occurred. */ - public DateAndTime getDateTime() { + public Date getDateTime() { return this.dateTime == null ? null : this.dateTime.getValue(); } /** * @param value The date/time at which the event occurred. */ - public DiagnosticOrderEventComponent setDateTime(DateAndTime value) { + public DiagnosticOrderEventComponent setDateTime(Date value) { if (this.dateTime == null) this.dateTime = new DateTimeType(); this.dateTime.setValue(value); @@ -735,7 +743,7 @@ public class DiagnosticOrder extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(DiagnosticOrderStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -1259,7 +1267,7 @@ public class DiagnosticOrder extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(DiagnosticOrderStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -1308,7 +1316,7 @@ public class DiagnosticOrder extends DomainResource { this.priority = null; else { if (this.priority == null) - this.priority = new Enumeration(); + this.priority = new Enumeration(DiagnosticOrderPriority.ENUM_FACTORY); this.priority.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java index f24e704d8f5..c96c987adee 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DiagnosticReport.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport") public class DiagnosticReport extends DomainResource { - public enum DiagnosticReportStatus { + public enum DiagnosticReportStatus implements FhirEnum { /** * The existence of the report is registered, but there is nothing yet available. */ @@ -82,7 +82,10 @@ public class DiagnosticReport extends DomainResource { * added to help the parsers */ NULL; - public static DiagnosticReportStatus fromCode(String codeString) throws Exception { + + public static final DiagnosticReportStatusEnumFactory ENUM_FACTORY = new DiagnosticReportStatusEnumFactory(); + + public static DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("registered".equals(codeString)) @@ -101,8 +104,9 @@ public class DiagnosticReport extends DomainResource { return CANCELLED; if ("entered in error".equals(codeString)) return ENTEREDINERROR; - throw new Exception("Unknown DiagnosticReportStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REGISTERED: return "registered"; @@ -157,8 +161,8 @@ public class DiagnosticReport extends DomainResource { } } - public static class DiagnosticReportStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DiagnosticReportStatusEnumFactory implements EnumFactory { + public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -178,9 +182,9 @@ public class DiagnosticReport extends DomainResource { return DiagnosticReportStatus.CANCELLED; if ("entered in error".equals(codeString)) return DiagnosticReportStatus.ENTEREDINERROR; - throw new Exception("Unknown DiagnosticReportStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DiagnosticReportStatus code) throws IllegalArgumentException { if (code == DiagnosticReportStatus.REGISTERED) return "registered"; if (code == DiagnosticReportStatus.PARTIAL) @@ -569,7 +573,7 @@ public class DiagnosticReport extends DomainResource { */ public DiagnosticReport setStatus(DiagnosticReportStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(DiagnosticReportStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -605,14 +609,14 @@ public class DiagnosticReport extends DomainResource { /** * @return The date and/or time that this version of the report was released from the source diagnostic service. */ - public DateAndTime getIssued() { + public Date getIssued() { return this.issued == null ? null : this.issued.getValue(); } /** * @param value The date and/or time that this version of the report was released from the source diagnostic service. */ - public DiagnosticReport setIssued(DateAndTime value) { + public DiagnosticReport setIssued(Date value) { if (this.issued == null) this.issued = new DateTimeType(); this.issued.setValue(value); @@ -1230,12 +1234,12 @@ public class DiagnosticReport extends DomainResource { public static final String SP_DATE = "date"; @SearchParamDefinition(name="patient", path="DiagnosticReport.subject", description="The subject of the report if a patient", type="reference" ) public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="request", path="DiagnosticReport.requestDetail", description="What was requested", type="reference" ) + public static final String SP_REQUEST = "request"; @SearchParamDefinition(name="specimen", path="DiagnosticReport.specimen", description="The specimen details", type="reference" ) public static final String SP_SPECIMEN = "specimen"; @SearchParamDefinition(name="name", path="DiagnosticReport.name", description="The name of the report (e.g. the code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result)", type="token" ) public static final String SP_NAME = "name"; - @SearchParamDefinition(name="request", path="DiagnosticReport.requestDetail", description="What was requested", type="reference" ) - public static final String SP_REQUEST = "request"; @SearchParamDefinition(name="service", path="DiagnosticReport.serviceCategory", description="Which diagnostic discipline/department created the report", type="token" ) public static final String SP_SERVICE = "service"; @SearchParamDefinition(name="performer", path="DiagnosticReport.performer", description="Who was the source of the report (organization)", type="reference" ) diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Distance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Distance.java index 82c2b900f4b..854db72c703 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Distance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Distance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import org.hl7.fhir.instance.model.annotations.DatatypeDef; /** diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java index 4e149d79822..47989cb13e5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentManifest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="DocumentManifest", profile="http://hl7.org/fhir/Profile/DocumentManifest") public class DocumentManifest extends DomainResource { - public enum DocumentReferenceStatus { + public enum DocumentReferenceStatus implements FhirEnum { /** * This is the current reference for this document. */ @@ -62,7 +62,10 @@ public class DocumentManifest extends DomainResource { * added to help the parsers */ NULL; - public static DocumentReferenceStatus fromCode(String codeString) throws Exception { + + public static final DocumentReferenceStatusEnumFactory ENUM_FACTORY = new DocumentReferenceStatusEnumFactory(); + + public static DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("current".equals(codeString)) @@ -71,8 +74,9 @@ public class DocumentManifest extends DomainResource { return SUPERCEDED; if ("entered in error".equals(codeString)) return ENTEREDINERROR; - throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case CURRENT: return "current"; @@ -107,8 +111,8 @@ public class DocumentManifest extends DomainResource { } } - public static class DocumentReferenceStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DocumentReferenceStatusEnumFactory implements EnumFactory { + public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class DocumentManifest extends DomainResource { return DocumentReferenceStatus.SUPERCEDED; if ("entered in error".equals(codeString)) return DocumentReferenceStatus.ENTEREDINERROR; - throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DocumentReferenceStatus code) throws IllegalArgumentException { if (code == DocumentReferenceStatus.CURRENT) return "current"; if (code == DocumentReferenceStatus.SUPERCEDED) @@ -485,14 +489,14 @@ public class DocumentManifest extends DomainResource { /** * @return When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc). */ - public DateAndTime getCreated() { + public Date getCreated() { return this.created == null ? null : this.created.getValue(); } /** * @param value When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc). */ - public DocumentManifest setCreated(DateAndTime value) { + public DocumentManifest setCreated(Date value) { if (value == null) this.created = null; else { @@ -592,7 +596,7 @@ public class DocumentManifest extends DomainResource { */ public DocumentManifest setStatus(DocumentReferenceStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(DocumentReferenceStatus.ENUM_FACTORY); this.status.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java index ef9e559db83..a360a09445d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DocumentReference.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/Profile/DocumentReference") public class DocumentReference extends DomainResource { - public enum DocumentReferenceStatus { + public enum DocumentReferenceStatus implements FhirEnum { /** * This is the current reference for this document. */ @@ -62,7 +62,10 @@ public class DocumentReference extends DomainResource { * added to help the parsers */ NULL; - public static DocumentReferenceStatus fromCode(String codeString) throws Exception { + + public static final DocumentReferenceStatusEnumFactory ENUM_FACTORY = new DocumentReferenceStatusEnumFactory(); + + public static DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("current".equals(codeString)) @@ -71,8 +74,9 @@ public class DocumentReference extends DomainResource { return SUPERCEDED; if ("entered in error".equals(codeString)) return ENTEREDINERROR; - throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case CURRENT: return "current"; @@ -107,8 +111,8 @@ public class DocumentReference extends DomainResource { } } - public static class DocumentReferenceStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DocumentReferenceStatusEnumFactory implements EnumFactory { + public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class DocumentReference extends DomainResource { return DocumentReferenceStatus.SUPERCEDED; if ("entered in error".equals(codeString)) return DocumentReferenceStatus.ENTEREDINERROR; - throw new Exception("Unknown DocumentReferenceStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DocumentReferenceStatus code) throws IllegalArgumentException { if (code == DocumentReferenceStatus.CURRENT) return "current"; if (code == DocumentReferenceStatus.SUPERCEDED) @@ -131,7 +135,7 @@ public class DocumentReference extends DomainResource { } } - public enum DocumentRelationshipType { + public enum DocumentRelationshipType implements FhirEnum { /** * This document logically replaces or supercedes the target document. */ @@ -152,7 +156,10 @@ public class DocumentReference extends DomainResource { * added to help the parsers */ NULL; - public static DocumentRelationshipType fromCode(String codeString) throws Exception { + + public static final DocumentRelationshipTypeEnumFactory ENUM_FACTORY = new DocumentRelationshipTypeEnumFactory(); + + public static DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("replaces".equals(codeString)) @@ -163,8 +170,9 @@ public class DocumentReference extends DomainResource { return SIGNS; if ("appends".equals(codeString)) return APPENDS; - throw new Exception("Unknown DocumentRelationshipType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REPLACES: return "replaces"; @@ -203,8 +211,8 @@ public class DocumentReference extends DomainResource { } } - public static class DocumentRelationshipTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DocumentRelationshipTypeEnumFactory implements EnumFactory { + public DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -216,9 +224,9 @@ public class DocumentReference extends DomainResource { return DocumentRelationshipType.SIGNS; if ("appends".equals(codeString)) return DocumentRelationshipType.APPENDS; - throw new Exception("Unknown DocumentRelationshipType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DocumentRelationshipType code) throws IllegalArgumentException { if (code == DocumentRelationshipType.REPLACES) return "replaces"; if (code == DocumentRelationshipType.TRANSFORMS) @@ -304,7 +312,7 @@ public class DocumentReference extends DomainResource { */ public DocumentReferenceRelatesToComponent setCode(DocumentRelationshipType value) { if (this.code == null) - this.code = new Enumeration(); + this.code = new Enumeration(DocumentRelationshipType.ENUM_FACTORY); this.code.setValue(value); return this; } @@ -1361,14 +1369,14 @@ public class DocumentReference extends DomainResource { /** * @return When the document was created. */ - public DateAndTime getCreated() { + public Date getCreated() { return this.created == null ? null : this.created.getValue(); } /** * @param value When the document was created. */ - public DocumentReference setCreated(DateAndTime value) { + public DocumentReference setCreated(Date value) { if (value == null) this.created = null; else { @@ -1410,14 +1418,14 @@ public class DocumentReference extends DomainResource { /** * @return When the document reference was created. */ - public DateAndTime getIndexed() { + public Date getIndexed() { return this.indexed == null ? null : this.indexed.getValue(); } /** * @param value When the document reference was created. */ - public DocumentReference setIndexed(DateAndTime value) { + public DocumentReference setIndexed(Date value) { if (this.indexed == null) this.indexed = new InstantType(); this.indexed.setValue(value); @@ -1464,7 +1472,7 @@ public class DocumentReference extends DomainResource { */ public DocumentReference setStatus(DocumentReferenceStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(DocumentReferenceStatus.ENUM_FACTORY); this.status.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DomainResource.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DomainResource.java index e4479119dbf..dcc64170e64 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DomainResource.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/DomainResource.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Duration.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Duration.java index 0072a5c9af0..fac79df98ab 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Duration.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Duration.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import org.hl7.fhir.instance.model.annotations.DatatypeDef; /** diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Element.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Element.java index 1febb0cb1d5..86b339dc31d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Element.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Element.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java index 8c47d4955ed..041b674e0bc 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ElementDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef; @DatatypeDef(name="ElementDefinition") public class ElementDefinition extends Type { - public enum PropertyRepresentation { + public enum PropertyRepresentation implements FhirEnum { /** * In XML, this property is represented as an attribute not an element. */ @@ -52,13 +52,17 @@ public class ElementDefinition extends Type { * added to help the parsers */ NULL; - public static PropertyRepresentation fromCode(String codeString) throws Exception { + + public static final PropertyRepresentationEnumFactory ENUM_FACTORY = new PropertyRepresentationEnumFactory(); + + public static PropertyRepresentation fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("xmlAttr".equals(codeString)) return XMLATTR; - throw new Exception("Unknown PropertyRepresentation code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case XMLATTR: return "xmlAttr"; @@ -85,23 +89,23 @@ public class ElementDefinition extends Type { } } - public static class PropertyRepresentationEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class PropertyRepresentationEnumFactory implements EnumFactory { + public PropertyRepresentation fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; if ("xmlAttr".equals(codeString)) return PropertyRepresentation.XMLATTR; - throw new Exception("Unknown PropertyRepresentation code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(PropertyRepresentation code) throws IllegalArgumentException { if (code == PropertyRepresentation.XMLATTR) return "xmlAttr"; return "?"; } } - public enum ResourceSlicingRules { + public enum ResourceSlicingRules implements FhirEnum { /** * No additional content is allowed other than that described by the slices in this profile. */ @@ -118,7 +122,10 @@ public class ElementDefinition extends Type { * added to help the parsers */ NULL; - public static ResourceSlicingRules fromCode(String codeString) throws Exception { + + public static final ResourceSlicingRulesEnumFactory ENUM_FACTORY = new ResourceSlicingRulesEnumFactory(); + + public static ResourceSlicingRules fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("closed".equals(codeString)) @@ -127,8 +134,9 @@ public class ElementDefinition extends Type { return OPEN; if ("openAtEnd".equals(codeString)) return OPENATEND; - throw new Exception("Unknown ResourceSlicingRules code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case CLOSED: return "closed"; @@ -163,8 +171,8 @@ public class ElementDefinition extends Type { } } - public static class ResourceSlicingRulesEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ResourceSlicingRulesEnumFactory implements EnumFactory { + public ResourceSlicingRules fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -174,9 +182,9 @@ public class ElementDefinition extends Type { return ResourceSlicingRules.OPEN; if ("openAtEnd".equals(codeString)) return ResourceSlicingRules.OPENATEND; - throw new Exception("Unknown ResourceSlicingRules code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceSlicingRules code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ResourceSlicingRules code) throws IllegalArgumentException { if (code == ResourceSlicingRules.CLOSED) return "closed"; if (code == ResourceSlicingRules.OPEN) @@ -187,7 +195,7 @@ public class ElementDefinition extends Type { } } - public enum ResourceAggregationMode { + public enum ResourceAggregationMode implements FhirEnum { /** * The reference is a local reference to a contained resource. */ @@ -204,7 +212,10 @@ public class ElementDefinition extends Type { * added to help the parsers */ NULL; - public static ResourceAggregationMode fromCode(String codeString) throws Exception { + + public static final ResourceAggregationModeEnumFactory ENUM_FACTORY = new ResourceAggregationModeEnumFactory(); + + public static ResourceAggregationMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("contained".equals(codeString)) @@ -213,8 +224,9 @@ public class ElementDefinition extends Type { return REFERENCED; if ("bundled".equals(codeString)) return BUNDLED; - throw new Exception("Unknown ResourceAggregationMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case CONTAINED: return "contained"; @@ -249,8 +261,8 @@ public class ElementDefinition extends Type { } } - public static class ResourceAggregationModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ResourceAggregationModeEnumFactory implements EnumFactory { + public ResourceAggregationMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -260,9 +272,9 @@ public class ElementDefinition extends Type { return ResourceAggregationMode.REFERENCED; if ("bundled".equals(codeString)) return ResourceAggregationMode.BUNDLED; - throw new Exception("Unknown ResourceAggregationMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceAggregationMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ResourceAggregationMode code) throws IllegalArgumentException { if (code == ResourceAggregationMode.CONTAINED) return "contained"; if (code == ResourceAggregationMode.REFERENCED) @@ -273,7 +285,7 @@ public class ElementDefinition extends Type { } } - public enum ConstraintSeverity { + public enum ConstraintSeverity implements FhirEnum { /** * If the constraint is violated, the resource is not conformant. */ @@ -286,15 +298,19 @@ public class ElementDefinition extends Type { * added to help the parsers */ NULL; - public static ConstraintSeverity fromCode(String codeString) throws Exception { + + public static final ConstraintSeverityEnumFactory ENUM_FACTORY = new ConstraintSeverityEnumFactory(); + + public static ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("error".equals(codeString)) return ERROR; if ("warning".equals(codeString)) return WARNING; - throw new Exception("Unknown ConstraintSeverity code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ERROR: return "error"; @@ -325,8 +341,8 @@ public class ElementDefinition extends Type { } } - public static class ConstraintSeverityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ConstraintSeverityEnumFactory implements EnumFactory { + public ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -334,9 +350,9 @@ public class ElementDefinition extends Type { return ConstraintSeverity.ERROR; if ("warning".equals(codeString)) return ConstraintSeverity.WARNING; - throw new Exception("Unknown ConstraintSeverity code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ConstraintSeverity code) throws IllegalArgumentException { if (code == ConstraintSeverity.ERROR) return "error"; if (code == ConstraintSeverity.WARNING) @@ -345,7 +361,7 @@ public class ElementDefinition extends Type { } } - public enum BindingConformance { + public enum BindingConformance implements FhirEnum { /** * Only codes in the specified set are allowed. If the binding is extensible, other codes may be used for concepts not covered by the bound set of codes. */ @@ -362,7 +378,10 @@ public class ElementDefinition extends Type { * added to help the parsers */ NULL; - public static BindingConformance fromCode(String codeString) throws Exception { + + public static final BindingConformanceEnumFactory ENUM_FACTORY = new BindingConformanceEnumFactory(); + + public static BindingConformance fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("required".equals(codeString)) @@ -371,8 +390,9 @@ public class ElementDefinition extends Type { return PREFERRED; if ("example".equals(codeString)) return EXAMPLE; - throw new Exception("Unknown BindingConformance code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUIRED: return "required"; @@ -407,8 +427,8 @@ public class ElementDefinition extends Type { } } - public static class BindingConformanceEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class BindingConformanceEnumFactory implements EnumFactory { + public BindingConformance fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -418,9 +438,9 @@ public class ElementDefinition extends Type { return BindingConformance.PREFERRED; if ("example".equals(codeString)) return BindingConformance.EXAMPLE; - throw new Exception("Unknown BindingConformance code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown BindingConformance code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(BindingConformance code) throws IllegalArgumentException { if (code == BindingConformance.REQUIRED) return "required"; if (code == BindingConformance.PREFERRED) @@ -663,7 +683,7 @@ public class ElementDefinition extends Type { */ public ElementDefinitionSlicingComponent setRules(ResourceSlicingRules value) { if (this.rules == null) - this.rules = new Enumeration(); + this.rules = new Enumeration(ResourceSlicingRules.ENUM_FACTORY); this.rules.setValue(value); return this; } @@ -1089,7 +1109,7 @@ public class ElementDefinition extends Type { */ public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { if (this.severity == null) - this.severity = new Enumeration(); + this.severity = new Enumeration(ConstraintSeverity.ENUM_FACTORY); this.severity.setValue(value); return this; } @@ -1393,7 +1413,7 @@ public class ElementDefinition extends Type { this.conformance = null; else { if (this.conformance == null) - this.conformance = new Enumeration(); + this.conformance = new Enumeration(BindingConformance.ENUM_FACTORY); this.conformance.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Eligibility.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java similarity index 79% rename from hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Eligibility.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java index 28aea5b990b..58b03c71f45 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Eligibility.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -41,8 +41,8 @@ import org.hl7.fhir.instance.model.annotations.Description; /** * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. */ -@ResourceDef(name="Eligibility", profile="http://hl7.org/fhir/Profile/Eligibility") -public class Eligibility extends DomainResource { +@ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest") +public class EligibilityRequest extends DomainResource { /** * The Response Business Identifier. @@ -68,9 +68,9 @@ public class Eligibility extends DomainResource { /** * The date when this resource was created. */ - @Child(name="date", type={DateType.class}, order=2, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who is target of the request. @@ -108,9 +108,9 @@ public class Eligibility extends DomainResource { */ protected Organization organizationTarget; - private static final long serialVersionUID = 459884579L; + private static final long serialVersionUID = 1836339504L; - public Eligibility() { + public EligibilityRequest() { super(); } @@ -150,7 +150,7 @@ public class Eligibility extends DomainResource { public Coding getRuleset() { if (this.ruleset == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Eligibility.ruleset"); + throw new Error("Attempt to auto-create EligibilityRequest.ruleset"); else if (Configuration.doAutoCreate()) this.ruleset = new Coding(); return this.ruleset; @@ -163,7 +163,7 @@ public class Eligibility extends DomainResource { /** * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) */ - public Eligibility setRuleset(Coding value) { + public EligibilityRequest setRuleset(Coding value) { this.ruleset = value; return this; } @@ -174,7 +174,7 @@ public class Eligibility extends DomainResource { public Coding getOriginalRuleset() { if (this.originalRuleset == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Eligibility.originalRuleset"); + throw new Error("Attempt to auto-create EligibilityRequest.originalRuleset"); else if (Configuration.doAutoCreate()) this.originalRuleset = new Coding(); return this.originalRuleset; @@ -187,56 +187,56 @@ public class Eligibility extends DomainResource { /** * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) */ - public Eligibility setOriginalRuleset(Coding value) { + public EligibilityRequest setOriginalRuleset(Coding value) { this.originalRuleset = value; return this; } /** - * @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Eligibility.date"); + throw new Error("Attempt to auto-create EligibilityRequest.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public Eligibility setDateElement(DateType value) { - this.date = value; + public EligibilityRequest setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when this resource was created. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when this resource was created. */ - public Eligibility setDate(DateAndTime value) { + public EligibilityRequest setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -247,7 +247,7 @@ public class Eligibility extends DomainResource { public Reference getTarget() { if (this.target == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Eligibility.target"); + throw new Error("Attempt to auto-create EligibilityRequest.target"); else if (Configuration.doAutoCreate()) this.target = new Reference(); return this.target; @@ -260,7 +260,7 @@ public class Eligibility extends DomainResource { /** * @param value {@link #target} (The Insurer who is target of the request.) */ - public Eligibility setTarget(Reference value) { + public EligibilityRequest setTarget(Reference value) { this.target = value; return this; } @@ -271,7 +271,7 @@ public class Eligibility extends DomainResource { public Organization getTargetTarget() { if (this.targetTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Eligibility.target"); + throw new Error("Attempt to auto-create EligibilityRequest.target"); else if (Configuration.doAutoCreate()) this.targetTarget = new Organization(); return this.targetTarget; @@ -280,7 +280,7 @@ public class Eligibility extends DomainResource { /** * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) */ - public Eligibility setTargetTarget(Organization value) { + public EligibilityRequest setTargetTarget(Organization value) { this.targetTarget = value; return this; } @@ -291,7 +291,7 @@ public class Eligibility extends DomainResource { public Reference getProvider() { if (this.provider == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Eligibility.provider"); + throw new Error("Attempt to auto-create EligibilityRequest.provider"); else if (Configuration.doAutoCreate()) this.provider = new Reference(); return this.provider; @@ -304,7 +304,7 @@ public class Eligibility extends DomainResource { /** * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) */ - public Eligibility setProvider(Reference value) { + public EligibilityRequest setProvider(Reference value) { this.provider = value; return this; } @@ -315,7 +315,7 @@ public class Eligibility extends DomainResource { public Practitioner getProviderTarget() { if (this.providerTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Eligibility.provider"); + throw new Error("Attempt to auto-create EligibilityRequest.provider"); else if (Configuration.doAutoCreate()) this.providerTarget = new Practitioner(); return this.providerTarget; @@ -324,7 +324,7 @@ public class Eligibility extends DomainResource { /** * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) */ - public Eligibility setProviderTarget(Practitioner value) { + public EligibilityRequest setProviderTarget(Practitioner value) { this.providerTarget = value; return this; } @@ -335,7 +335,7 @@ public class Eligibility extends DomainResource { public Reference getOrganization() { if (this.organization == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Eligibility.organization"); + throw new Error("Attempt to auto-create EligibilityRequest.organization"); else if (Configuration.doAutoCreate()) this.organization = new Reference(); return this.organization; @@ -348,7 +348,7 @@ public class Eligibility extends DomainResource { /** * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) */ - public Eligibility setOrganization(Reference value) { + public EligibilityRequest setOrganization(Reference value) { this.organization = value; return this; } @@ -359,7 +359,7 @@ public class Eligibility extends DomainResource { public Organization getOrganizationTarget() { if (this.organizationTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Eligibility.organization"); + throw new Error("Attempt to auto-create EligibilityRequest.organization"); else if (Configuration.doAutoCreate()) this.organizationTarget = new Organization(); return this.organizationTarget; @@ -368,7 +368,7 @@ public class Eligibility extends DomainResource { /** * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) */ - public Eligibility setOrganizationTarget(Organization value) { + public EligibilityRequest setOrganizationTarget(Organization value) { this.organizationTarget = value; return this; } @@ -378,14 +378,14 @@ public class Eligibility extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); } - public Eligibility copy() { - Eligibility dst = new Eligibility(); + public EligibilityRequest copy() { + EligibilityRequest dst = new EligibilityRequest(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList(); @@ -394,30 +394,30 @@ public class Eligibility extends DomainResource { }; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); return dst; } - protected Eligibility typedCopy() { + protected EligibilityRequest typedCopy() { return copy(); } public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) ; } @Override public ResourceType getResourceType() { - return ResourceType.Eligibility; + return ResourceType.EligibilityRequest; } - @SearchParamDefinition(name="identifier", path="Eligibility.identifier", description="The business identifier of the Eligibility", type="token" ) + @SearchParamDefinition(name="identifier", path="EligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" ) public static final String SP_IDENTIFIER = "identifier"; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java index 0b9bd9b9a88..1ef1bd330e7 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EligibilityResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="EligibilityResponse", profile="http://hl7.org/fhir/Profile/EligibilityResponse") public class EligibilityResponse extends DomainResource { - public enum RSLink { + public enum RSLink implements FhirEnum { /** * The processing completed without errors. */ @@ -58,15 +58,19 @@ public class EligibilityResponse extends DomainResource { * added to help the parsers */ NULL; - public static RSLink fromCode(String codeString) throws Exception { + + public static final RSLinkEnumFactory ENUM_FACTORY = new RSLinkEnumFactory(); + + public static RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("complete".equals(codeString)) return COMPLETE; if ("error".equals(codeString)) return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case COMPLETE: return "complete"; @@ -97,8 +101,8 @@ public class EligibilityResponse extends DomainResource { } } - public static class RSLinkEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -106,9 +110,9 @@ public class EligibilityResponse extends DomainResource { return RSLink.COMPLETE; if ("error".equals(codeString)) return RSLink.ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(RSLink code) throws IllegalArgumentException { if (code == RSLink.COMPLETE) return "complete"; if (code == RSLink.ERROR) @@ -127,14 +131,14 @@ public class EligibilityResponse extends DomainResource { /** * Original request resource referrence. */ - @Child(name="request", type={Eligibility.class}, order=0, min=0, max=1) + @Child(name="request", type={EligibilityRequest.class}, order=0, min=0, max=1) @Description(shortDefinition="Claim reference", formalDefinition="Original request resource referrence." ) protected Reference request; /** * The actual object that is the target of the reference (Original request resource referrence.) */ - protected Eligibility requestTarget; + protected EligibilityRequest requestTarget; /** * Transaction status: error, complete. @@ -167,9 +171,9 @@ public class EligibilityResponse extends DomainResource { /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name="date", type={DateType.class}, order=5, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who produced this adjudicated response. @@ -207,7 +211,7 @@ public class EligibilityResponse extends DomainResource { */ protected Organization requestOrganizationTarget; - private static final long serialVersionUID = -281414348L; + private static final long serialVersionUID = 241710852L; public EligibilityResponse() { super(); @@ -270,19 +274,19 @@ public class EligibilityResponse extends DomainResource { /** * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) */ - public Eligibility getRequestTarget() { + public EligibilityRequest getRequestTarget() { if (this.requestTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create EligibilityResponse.request"); else if (Configuration.doAutoCreate()) - this.requestTarget = new Eligibility(); + this.requestTarget = new EligibilityRequest(); return this.requestTarget; } /** * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) */ - public EligibilityResponse setRequestTarget(Eligibility value) { + public EligibilityResponse setRequestTarget(EligibilityRequest value) { this.requestTarget = value; return this; } @@ -330,7 +334,7 @@ public class EligibilityResponse extends DomainResource { this.outcome = null; else { if (this.outcome == null) - this.outcome = new Enumeration(); + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); this.outcome.setValue(value); } return this; @@ -434,50 +438,50 @@ public class EligibilityResponse extends DomainResource { } /** - * @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.date"); + throw new Error("Attempt to auto-create EligibilityResponse.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public EligibilityResponse setDateElement(DateType value) { - this.date = value; + public EligibilityResponse setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when the enclosed suite of services were performed or completed. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when the enclosed suite of services were performed or completed. */ - public EligibilityResponse setDate(DateAndTime value) { + public EligibilityResponse setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -617,12 +621,12 @@ public class EligibilityResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(Eligibility)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("request", "Reference(EligibilityRequest)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); @@ -641,7 +645,7 @@ public class EligibilityResponse extends DomainResource { dst.disposition = disposition == null ? null : disposition.copy(); dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.organization = organization == null ? null : organization.copy(); dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); @@ -656,8 +660,9 @@ public class EligibilityResponse extends DomainResource { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty()) - && (requestOrganization == null || requestOrganization.isEmpty()); + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; } @Override diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Encounter.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Encounter.java index aa84ead1384..169a31a6945 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Encounter.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Encounter.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Encounter", profile="http://hl7.org/fhir/Profile/Encounter") public class Encounter extends DomainResource { - public enum EncounterState { + public enum EncounterState implements FhirEnum { /** * The Encounter has not yet started. */ @@ -70,7 +70,10 @@ public class Encounter extends DomainResource { * added to help the parsers */ NULL; - public static EncounterState fromCode(String codeString) throws Exception { + + public static final EncounterStateEnumFactory ENUM_FACTORY = new EncounterStateEnumFactory(); + + public static EncounterState fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("planned".equals(codeString)) @@ -83,8 +86,9 @@ public class Encounter extends DomainResource { return FINISHED; if ("cancelled".equals(codeString)) return CANCELLED; - throw new Exception("Unknown EncounterState code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PLANNED: return "planned"; @@ -127,8 +131,8 @@ public class Encounter extends DomainResource { } } - public static class EncounterStateEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class EncounterStateEnumFactory implements EnumFactory { + public EncounterState fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -142,9 +146,9 @@ public class Encounter extends DomainResource { return EncounterState.FINISHED; if ("cancelled".equals(codeString)) return EncounterState.CANCELLED; - throw new Exception("Unknown EncounterState code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(EncounterState code) throws IllegalArgumentException { if (code == EncounterState.PLANNED) return "planned"; if (code == EncounterState.INPROGRESS) @@ -159,7 +163,7 @@ public class Encounter extends DomainResource { } } - public enum EncounterClass { + public enum EncounterClass implements FhirEnum { /** * An encounter during which the patient is hospitalized and stays overnight. */ @@ -196,7 +200,10 @@ public class Encounter extends DomainResource { * added to help the parsers */ NULL; - public static EncounterClass fromCode(String codeString) throws Exception { + + public static final EncounterClassEnumFactory ENUM_FACTORY = new EncounterClassEnumFactory(); + + public static EncounterClass fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("inpatient".equals(codeString)) @@ -215,8 +222,9 @@ public class Encounter extends DomainResource { return DAYTIME; if ("virtual".equals(codeString)) return VIRTUAL; - throw new Exception("Unknown EncounterClass code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case INPATIENT: return "inpatient"; @@ -271,8 +279,8 @@ public class Encounter extends DomainResource { } } - public static class EncounterClassEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class EncounterClassEnumFactory implements EnumFactory { + public EncounterClass fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -292,9 +300,9 @@ public class Encounter extends DomainResource { return EncounterClass.DAYTIME; if ("virtual".equals(codeString)) return EncounterClass.VIRTUAL; - throw new Exception("Unknown EncounterClass code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(EncounterClass code) throws IllegalArgumentException { if (code == EncounterClass.INPATIENT) return "inpatient"; if (code == EncounterClass.OUTPATIENT) @@ -1443,7 +1451,7 @@ public class Encounter extends DomainResource { */ public Encounter setStatus(EncounterState value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(EncounterState.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1488,7 +1496,7 @@ public class Encounter extends DomainResource { */ public Encounter setClass_(EncounterClass value) { if (this.class_ == null) - this.class_ = new Enumeration(); + this.class_ = new Enumeration(EncounterClass.ENUM_FACTORY); this.class_.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enrollment.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java similarity index 80% rename from hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enrollment.java rename to hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java index 52f0a1856fc..9b1f179a7c6 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enrollment.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -41,8 +41,8 @@ import org.hl7.fhir.instance.model.annotations.Description; /** * This resource provides the insurance Enrollment details to the insurer regarding a specified coverage. */ -@ResourceDef(name="Enrollment", profile="http://hl7.org/fhir/Profile/Enrollment") -public class Enrollment extends DomainResource { +@ResourceDef(name="EnrollmentRequest", profile="http://hl7.org/fhir/Profile/EnrollmentRequest") +public class EnrollmentRequest extends DomainResource { /** * The Response Business Identifier. @@ -68,9 +68,9 @@ public class Enrollment extends DomainResource { /** * The date when this resource was created. */ - @Child(name="date", type={DateType.class}, order=2, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who is target of the request. @@ -139,13 +139,13 @@ public class Enrollment extends DomainResource { @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) protected Coding relationship; - private static final long serialVersionUID = -321200192L; + private static final long serialVersionUID = -1656505325L; - public Enrollment() { + public EnrollmentRequest() { super(); } - public Enrollment(Reference subject, Reference coverage, Coding relationship) { + public EnrollmentRequest(Reference subject, Reference coverage, Coding relationship) { super(); this.subject = subject; this.coverage = coverage; @@ -188,7 +188,7 @@ public class Enrollment extends DomainResource { public Coding getRuleset() { if (this.ruleset == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.ruleset"); + throw new Error("Attempt to auto-create EnrollmentRequest.ruleset"); else if (Configuration.doAutoCreate()) this.ruleset = new Coding(); return this.ruleset; @@ -201,7 +201,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) */ - public Enrollment setRuleset(Coding value) { + public EnrollmentRequest setRuleset(Coding value) { this.ruleset = value; return this; } @@ -212,7 +212,7 @@ public class Enrollment extends DomainResource { public Coding getOriginalRuleset() { if (this.originalRuleset == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.originalRuleset"); + throw new Error("Attempt to auto-create EnrollmentRequest.originalRuleset"); else if (Configuration.doAutoCreate()) this.originalRuleset = new Coding(); return this.originalRuleset; @@ -225,56 +225,56 @@ public class Enrollment extends DomainResource { /** * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) */ - public Enrollment setOriginalRuleset(Coding value) { + public EnrollmentRequest setOriginalRuleset(Coding value) { this.originalRuleset = value; return this; } /** - * @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.date"); + throw new Error("Attempt to auto-create EnrollmentRequest.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public Enrollment setDateElement(DateType value) { - this.date = value; + public EnrollmentRequest setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when this resource was created. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when this resource was created. */ - public Enrollment setDate(DateAndTime value) { + public EnrollmentRequest setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -285,7 +285,7 @@ public class Enrollment extends DomainResource { public Reference getTarget() { if (this.target == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.target"); + throw new Error("Attempt to auto-create EnrollmentRequest.target"); else if (Configuration.doAutoCreate()) this.target = new Reference(); return this.target; @@ -298,7 +298,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #target} (The Insurer who is target of the request.) */ - public Enrollment setTarget(Reference value) { + public EnrollmentRequest setTarget(Reference value) { this.target = value; return this; } @@ -309,7 +309,7 @@ public class Enrollment extends DomainResource { public Organization getTargetTarget() { if (this.targetTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.target"); + throw new Error("Attempt to auto-create EnrollmentRequest.target"); else if (Configuration.doAutoCreate()) this.targetTarget = new Organization(); return this.targetTarget; @@ -318,7 +318,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) */ - public Enrollment setTargetTarget(Organization value) { + public EnrollmentRequest setTargetTarget(Organization value) { this.targetTarget = value; return this; } @@ -329,7 +329,7 @@ public class Enrollment extends DomainResource { public Reference getProvider() { if (this.provider == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.provider"); + throw new Error("Attempt to auto-create EnrollmentRequest.provider"); else if (Configuration.doAutoCreate()) this.provider = new Reference(); return this.provider; @@ -342,7 +342,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) */ - public Enrollment setProvider(Reference value) { + public EnrollmentRequest setProvider(Reference value) { this.provider = value; return this; } @@ -353,7 +353,7 @@ public class Enrollment extends DomainResource { public Practitioner getProviderTarget() { if (this.providerTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.provider"); + throw new Error("Attempt to auto-create EnrollmentRequest.provider"); else if (Configuration.doAutoCreate()) this.providerTarget = new Practitioner(); return this.providerTarget; @@ -362,7 +362,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) */ - public Enrollment setProviderTarget(Practitioner value) { + public EnrollmentRequest setProviderTarget(Practitioner value) { this.providerTarget = value; return this; } @@ -373,7 +373,7 @@ public class Enrollment extends DomainResource { public Reference getOrganization() { if (this.organization == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.organization"); + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); else if (Configuration.doAutoCreate()) this.organization = new Reference(); return this.organization; @@ -386,7 +386,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) */ - public Enrollment setOrganization(Reference value) { + public EnrollmentRequest setOrganization(Reference value) { this.organization = value; return this; } @@ -397,7 +397,7 @@ public class Enrollment extends DomainResource { public Organization getOrganizationTarget() { if (this.organizationTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.organization"); + throw new Error("Attempt to auto-create EnrollmentRequest.organization"); else if (Configuration.doAutoCreate()) this.organizationTarget = new Organization(); return this.organizationTarget; @@ -406,7 +406,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) */ - public Enrollment setOrganizationTarget(Organization value) { + public EnrollmentRequest setOrganizationTarget(Organization value) { this.organizationTarget = value; return this; } @@ -417,7 +417,7 @@ public class Enrollment extends DomainResource { public Reference getSubject() { if (this.subject == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.subject"); + throw new Error("Attempt to auto-create EnrollmentRequest.subject"); else if (Configuration.doAutoCreate()) this.subject = new Reference(); return this.subject; @@ -430,7 +430,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #subject} (Patient Resource.) */ - public Enrollment setSubject(Reference value) { + public EnrollmentRequest setSubject(Reference value) { this.subject = value; return this; } @@ -441,7 +441,7 @@ public class Enrollment extends DomainResource { public Patient getSubjectTarget() { if (this.subjectTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.subject"); + throw new Error("Attempt to auto-create EnrollmentRequest.subject"); else if (Configuration.doAutoCreate()) this.subjectTarget = new Patient(); return this.subjectTarget; @@ -450,7 +450,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) */ - public Enrollment setSubjectTarget(Patient value) { + public EnrollmentRequest setSubjectTarget(Patient value) { this.subjectTarget = value; return this; } @@ -461,7 +461,7 @@ public class Enrollment extends DomainResource { public Reference getCoverage() { if (this.coverage == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.coverage"); + throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); else if (Configuration.doAutoCreate()) this.coverage = new Reference(); return this.coverage; @@ -474,7 +474,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) */ - public Enrollment setCoverage(Reference value) { + public EnrollmentRequest setCoverage(Reference value) { this.coverage = value; return this; } @@ -485,7 +485,7 @@ public class Enrollment extends DomainResource { public Coverage getCoverageTarget() { if (this.coverageTarget == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.coverage"); + throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); else if (Configuration.doAutoCreate()) this.coverageTarget = new Coverage(); return this.coverageTarget; @@ -494,7 +494,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) */ - public Enrollment setCoverageTarget(Coverage value) { + public EnrollmentRequest setCoverageTarget(Coverage value) { this.coverageTarget = value; return this; } @@ -505,7 +505,7 @@ public class Enrollment extends DomainResource { public Coding getRelationship() { if (this.relationship == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Enrollment.relationship"); + throw new Error("Attempt to auto-create EnrollmentRequest.relationship"); else if (Configuration.doAutoCreate()) this.relationship = new Coding(); return this.relationship; @@ -518,7 +518,7 @@ public class Enrollment extends DomainResource { /** * @param value {@link #relationship} (The relationship of the patient to the subscriber.) */ - public Enrollment setRelationship(Coding value) { + public EnrollmentRequest setRelationship(Coding value) { this.relationship = value; return this; } @@ -528,7 +528,7 @@ public class Enrollment extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); @@ -537,8 +537,8 @@ public class Enrollment extends DomainResource { childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); } - public Enrollment copy() { - Enrollment dst = new Enrollment(); + public EnrollmentRequest copy() { + EnrollmentRequest dst = new EnrollmentRequest(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList(); @@ -547,7 +547,7 @@ public class Enrollment extends DomainResource { }; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); @@ -557,13 +557,13 @@ public class Enrollment extends DomainResource { return dst; } - protected Enrollment typedCopy() { + protected EnrollmentRequest typedCopy() { return copy(); } public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) && (subject == null || subject.isEmpty()) && (coverage == null || coverage.isEmpty()) && (relationship == null || relationship.isEmpty()) ; @@ -571,14 +571,14 @@ public class Enrollment extends DomainResource { @Override public ResourceType getResourceType() { - return ResourceType.Enrollment; + return ResourceType.EnrollmentRequest; } - @SearchParamDefinition(name="patient", path="Enrollment.subject", description="The party to be enrolled", type="reference" ) + @SearchParamDefinition(name="patient", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) public static final String SP_PATIENT = "patient"; - @SearchParamDefinition(name="subject", path="Enrollment.subject", description="The party to be enrolled", type="reference" ) + @SearchParamDefinition(name="subject", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) public static final String SP_SUBJECT = "subject"; - @SearchParamDefinition(name="identifier", path="Enrollment.identifier", description="The business identifier of the Enrollment", type="token" ) + @SearchParamDefinition(name="identifier", path="EnrollmentRequest.identifier", description="The business identifier of the Enrollment", type="token" ) public static final String SP_IDENTIFIER = "identifier"; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java index 564ca724215..6f09f9b3dd6 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnrollmentResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="EnrollmentResponse", profile="http://hl7.org/fhir/Profile/EnrollmentResponse") public class EnrollmentResponse extends DomainResource { - public enum RSLink { + public enum RSLink implements FhirEnum { /** * The processing completed without errors. */ @@ -58,15 +58,19 @@ public class EnrollmentResponse extends DomainResource { * added to help the parsers */ NULL; - public static RSLink fromCode(String codeString) throws Exception { + + public static final RSLinkEnumFactory ENUM_FACTORY = new RSLinkEnumFactory(); + + public static RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("complete".equals(codeString)) return COMPLETE; if ("error".equals(codeString)) return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case COMPLETE: return "complete"; @@ -97,8 +101,8 @@ public class EnrollmentResponse extends DomainResource { } } - public static class RSLinkEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -106,9 +110,9 @@ public class EnrollmentResponse extends DomainResource { return RSLink.COMPLETE; if ("error".equals(codeString)) return RSLink.ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(RSLink code) throws IllegalArgumentException { if (code == RSLink.COMPLETE) return "complete"; if (code == RSLink.ERROR) @@ -127,14 +131,14 @@ public class EnrollmentResponse extends DomainResource { /** * Original request resource referrence. */ - @Child(name="request", type={Enrollment.class}, order=0, min=0, max=1) + @Child(name="request", type={EnrollmentRequest.class}, order=0, min=0, max=1) @Description(shortDefinition="Claim reference", formalDefinition="Original request resource referrence." ) protected Reference request; /** * The actual object that is the target of the reference (Original request resource referrence.) */ - protected Enrollment requestTarget; + protected EnrollmentRequest requestTarget; /** * Transaction status: error, complete. @@ -167,9 +171,9 @@ public class EnrollmentResponse extends DomainResource { /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name="date", type={DateType.class}, order=5, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who produced this adjudicated response. @@ -207,7 +211,7 @@ public class EnrollmentResponse extends DomainResource { */ protected Organization requestOrganizationTarget; - private static final long serialVersionUID = -153876887L; + private static final long serialVersionUID = -318929031L; public EnrollmentResponse() { super(); @@ -270,19 +274,19 @@ public class EnrollmentResponse extends DomainResource { /** * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) */ - public Enrollment getRequestTarget() { + public EnrollmentRequest getRequestTarget() { if (this.requestTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create EnrollmentResponse.request"); else if (Configuration.doAutoCreate()) - this.requestTarget = new Enrollment(); + this.requestTarget = new EnrollmentRequest(); return this.requestTarget; } /** * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) */ - public EnrollmentResponse setRequestTarget(Enrollment value) { + public EnrollmentResponse setRequestTarget(EnrollmentRequest value) { this.requestTarget = value; return this; } @@ -330,7 +334,7 @@ public class EnrollmentResponse extends DomainResource { this.outcome = null; else { if (this.outcome == null) - this.outcome = new Enumeration(); + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); this.outcome.setValue(value); } return this; @@ -434,50 +438,50 @@ public class EnrollmentResponse extends DomainResource { } /** - * @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.date"); + throw new Error("Attempt to auto-create EnrollmentResponse.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public EnrollmentResponse setDateElement(DateType value) { - this.date = value; + public EnrollmentResponse setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when the enclosed suite of services were performed or completed. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when the enclosed suite of services were performed or completed. */ - public EnrollmentResponse setDate(DateAndTime value) { + public EnrollmentResponse setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -617,12 +621,12 @@ public class EnrollmentResponse extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(Enrollment)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("request", "Reference(EnrollmentRequest)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); @@ -641,7 +645,7 @@ public class EnrollmentResponse extends DomainResource { dst.disposition = disposition == null ? null : disposition.copy(); dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.organization = organization == null ? null : organization.copy(); dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); @@ -656,8 +660,9 @@ public class EnrollmentResponse extends DomainResource { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty()) - && (requestOrganization == null || requestOrganization.isEmpty()); + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; } @Override diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java index 81010f40a62..d0e3b507e0e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/EnumFactory.java @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. /** * Helper class to help manage generic enumerated types */ -public interface EnumFactory { +public interface EnumFactory> { /** * Read an enumeration value from the string that represents it on the XML or JSON @@ -41,7 +41,7 @@ public interface EnumFactory { * @return the enumeration value * @throws Exception is the value is not known */ - public Enum fromCode(String codeString) throws Exception; + public T fromCode(String codeString) throws IllegalArgumentException; /** * Get the XML/JSON representation for an enumerated value @@ -49,6 +49,6 @@ public interface EnumFactory { * @return the XML/JSON representation * @throws Exception if the enumeration is not valid (would usually indicate a code generation bug) */ - public String toCode(Enum code) throws Exception; + public String toCode(T code) throws IllegalArgumentException; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enumeration.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enumeration.java index 5afa89c1d89..70a2c50bf8a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enumeration.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Enumeration.java @@ -35,73 +35,70 @@ POSSIBILITY OF SUCH DAMAGE. */ public class Enumeration> extends PrimitiveType { - private static final long serialVersionUID = 5502756236610771914L; - + private static final long serialVersionUID = 1L; + private EnumFactory myEnumFactory; + /** - * the actual value of the enumeration + * Constructor */ - private T value; - - public Enumeration() { - } - - /** - * @param value the value of the enumeration - */ - public Enumeration(T value) { - this.value = value; - } - - /** - * @return the value of the enumeration - */ - public T getValue() { - return value; - } - - /** - * @param value the value of the enumeration - */ - public void setValue(T value) { - this.value = value; - } - - @Override - protected T parse(String theValue) { - return null; - } - - @Override - protected String encode(T theValue) { - return null; - } - - @Override - public Enumeration copy() { - Enumeration dst = new Enumeration(); - dst.value = value; - return dst; + public Enumeration(T theValue) { + setValue(theValue); } - - @Override - public String asStringValue() { - EnumFactory factory = ResourceEnumerations.getEnumFactory(value.getClass()); - if (factory != null) - try { - return factory.toCode(value); - } catch (Exception e) { - } - return value.toString(); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.toString().equals("NULL")); + /** + * Constructor + */ + public Enumeration(String theValue) { + setValueAsString(theValue); } - public boolean hasValue() { - return value != null & !value.toString().equals("NULL"); + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory, T theValue) { + myEnumFactory = theEnumFactory; + setValue(theValue); } - + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory, String theValue) { + myEnumFactory = theEnumFactory; + setValueAsString(theValue); + } + + /** + * Constructor + */ + public Enumeration(EnumFactory theEnumFactory) { + myEnumFactory = theEnumFactory; + } + + /** + * Constructor + */ + public Enumeration() { + // nothing + } + + @Override + protected T parse(String theValue) { + if (myEnumFactory != null) { + return myEnumFactory.fromCode(theValue); + } + return null; + } + + @Override + protected String encode(T theValue) { + return ((FhirEnum)theValue).toCode(); + } + + @Override + public Enumeration copy() { + return new Enumeration(myEnumFactory, getValue()); + } + } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java index fe55013016b..e8100b923a1 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExplanationOfBenefit.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="ExplanationOfBenefit", profile="http://hl7.org/fhir/Profile/ExplanationOfBenefit") public class ExplanationOfBenefit extends DomainResource { - public enum RSLink { + public enum RSLink implements FhirEnum { /** * The processing completed without errors. */ @@ -58,15 +58,19 @@ public class ExplanationOfBenefit extends DomainResource { * added to help the parsers */ NULL; - public static RSLink fromCode(String codeString) throws Exception { + + public static final RSLinkEnumFactory ENUM_FACTORY = new RSLinkEnumFactory(); + + public static RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("complete".equals(codeString)) return COMPLETE; if ("error".equals(codeString)) return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case COMPLETE: return "complete"; @@ -97,8 +101,8 @@ public class ExplanationOfBenefit extends DomainResource { } } - public static class RSLinkEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -106,9 +110,9 @@ public class ExplanationOfBenefit extends DomainResource { return RSLink.COMPLETE; if ("error".equals(codeString)) return RSLink.ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(RSLink code) throws IllegalArgumentException { if (code == RSLink.COMPLETE) return "complete"; if (code == RSLink.ERROR) @@ -167,9 +171,9 @@ public class ExplanationOfBenefit extends DomainResource { /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name="date", type={DateType.class}, order=5, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who produced this adjudicated response. @@ -207,7 +211,7 @@ public class ExplanationOfBenefit extends DomainResource { */ protected Organization requestOrganizationTarget; - private static final long serialVersionUID = -1007936689L; + private static final long serialVersionUID = 1627363360L; public ExplanationOfBenefit() { super(); @@ -330,7 +334,7 @@ public class ExplanationOfBenefit extends DomainResource { this.outcome = null; else { if (this.outcome == null) - this.outcome = new Enumeration(); + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); this.outcome.setValue(value); } return this; @@ -434,50 +438,50 @@ public class ExplanationOfBenefit extends DomainResource { } /** - * @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.date"); + throw new Error("Attempt to auto-create ExplanationOfBenefit.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public ExplanationOfBenefit setDateElement(DateType value) { - this.date = value; + public ExplanationOfBenefit setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when the enclosed suite of services were performed or completed. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when the enclosed suite of services were performed or completed. */ - public ExplanationOfBenefit setDate(DateAndTime value) { + public ExplanationOfBenefit setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -622,7 +626,7 @@ public class ExplanationOfBenefit extends DomainResource { childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); @@ -641,7 +645,7 @@ public class ExplanationOfBenefit extends DomainResource { dst.disposition = disposition == null ? null : disposition.copy(); dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.organization = organization == null ? null : organization.copy(); dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); @@ -656,8 +660,9 @@ public class ExplanationOfBenefit extends DomainResource { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty()) - && (requestOrganization == null || requestOrganization.isEmpty()); + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + ; } @Override diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Extension.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Extension.java index 2c934ed8c85..1b38f226889 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Extension.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Extension.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionDefinition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionDefinition.java index 1d1901f1a0c..a2580aafb7f 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionDefinition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ExtensionDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="ExtensionDefinition", profile="http://hl7.org/fhir/Profile/ExtensionDefinition") public class ExtensionDefinition extends DomainResource { - public enum ResourceProfileStatus { + public enum ResourceProfileStatus implements FhirEnum { /** * This profile is still under development. */ @@ -62,7 +62,10 @@ public class ExtensionDefinition extends DomainResource { * added to help the parsers */ NULL; - public static ResourceProfileStatus fromCode(String codeString) throws Exception { + + public static final ResourceProfileStatusEnumFactory ENUM_FACTORY = new ResourceProfileStatusEnumFactory(); + + public static ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("draft".equals(codeString)) @@ -71,8 +74,9 @@ public class ExtensionDefinition extends DomainResource { return ACTIVE; if ("retired".equals(codeString)) return RETIRED; - throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DRAFT: return "draft"; @@ -107,8 +111,8 @@ public class ExtensionDefinition extends DomainResource { } } - public static class ResourceProfileStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ResourceProfileStatusEnumFactory implements EnumFactory { + public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class ExtensionDefinition extends DomainResource { return ResourceProfileStatus.ACTIVE; if ("retired".equals(codeString)) return ResourceProfileStatus.RETIRED; - throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ResourceProfileStatus code) throws IllegalArgumentException { if (code == ResourceProfileStatus.DRAFT) return "draft"; if (code == ResourceProfileStatus.ACTIVE) @@ -131,7 +135,7 @@ public class ExtensionDefinition extends DomainResource { } } - public enum ExtensionContext { + public enum ExtensionContext implements FhirEnum { /** * The context is all elements matching a particular resource element path. */ @@ -152,7 +156,10 @@ public class ExtensionDefinition extends DomainResource { * added to help the parsers */ NULL; - public static ExtensionContext fromCode(String codeString) throws Exception { + + public static final ExtensionContextEnumFactory ENUM_FACTORY = new ExtensionContextEnumFactory(); + + public static ExtensionContext fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("resource".equals(codeString)) @@ -163,8 +170,9 @@ public class ExtensionDefinition extends DomainResource { return MAPPING; if ("extension".equals(codeString)) return EXTENSION; - throw new Exception("Unknown ExtensionContext code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case RESOURCE: return "resource"; @@ -203,8 +211,8 @@ public class ExtensionDefinition extends DomainResource { } } - public static class ExtensionContextEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ExtensionContextEnumFactory implements EnumFactory { + public ExtensionContext fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -216,9 +224,9 @@ public class ExtensionDefinition extends DomainResource { return ExtensionContext.MAPPING; if ("extension".equals(codeString)) return ExtensionContext.EXTENSION; - throw new Exception("Unknown ExtensionContext code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ExtensionContext code) throws IllegalArgumentException { if (code == ExtensionContext.RESOURCE) return "resource"; if (code == ExtensionContext.DATATYPE) @@ -982,7 +990,7 @@ public class ExtensionDefinition extends DomainResource { */ public ExtensionDefinition setStatus(ResourceProfileStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ResourceProfileStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1067,14 +1075,14 @@ public class ExtensionDefinition extends DomainResource { /** * @return The date that this version of the extension was published. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date that this version of the extension was published. */ - public ExtensionDefinition setDate(DateAndTime value) { + public ExtensionDefinition setDate(Date value) { if (value == null) this.date = null; else { @@ -1204,7 +1212,7 @@ public class ExtensionDefinition extends DomainResource { */ public ExtensionDefinition setContextType(ExtensionContext value) { if (this.contextType == null) - this.contextType = new Enumeration(); + this.contextType = new Enumeration(ExtensionContext.ENUM_FACTORY); this.contextType.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Factory.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Factory.java deleted file mode 100644 index e60cb030e6e..00000000000 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Factory.java +++ /dev/null @@ -1,175 +0,0 @@ -package org.hl7.fhir.instance.model; - -import java.net.URISyntaxException; -import java.text.ParseException; - -import org.hl7.fhir.instance.model.ContactPoint.ContactPointSystem; - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - - - -public class Factory { - - public static IdType newId(String value) { - if (value == null) - return null; - IdType res = new IdType(); - res.setValue(value); - return res; - } - - public static StringType newString_(String value) { - if (value == null) - return null; - StringType res = new StringType(); - res.setValue(value); - return res; - } - - public static UriType newUri(String value) throws URISyntaxException { - if (value == null) - return null; - UriType res = new UriType(); - res.setValue(value); - return res; - } - - public static DateTimeType newDateTime(String value) throws ParseException { - if (value == null) - return null; - DateTimeType res = new DateTimeType(); - res.setValue(new DateAndTime(value)); - return res; - } - - public static DateType newDate(String value) throws ParseException { - if (value == null) - return null; - DateType res = new DateType(); - res.setValue(new DateAndTime(value)); - return res; - } - - public static CodeType newCode(String value) { - if (value == null) - return null; - CodeType res = new CodeType(); - res.setValue(value); - return res; - } - - public static IntegerType newInteger(int value) { - IntegerType res = new IntegerType(); - res.setValue(value); - return res; - } - - public static IntegerType newInteger(java.lang.Integer value) { - if (value == null) - return null; - IntegerType res = new IntegerType(); - res.setValue(value); - return res; - } - - public static BooleanType newBoolean(boolean value) { - BooleanType res = new BooleanType(); - res.setValue(value); - return res; - } - - public static ContactPoint newContactPoint(ContactPointSystem system, String value) { - ContactPoint res = new ContactPoint(); - res.setSystem(system); - res.setValue(value); - return res; - } - - public static Extension newExtension(String uri, Type value, boolean evenIfNull) throws Exception { - if (!evenIfNull && value == null) - return null; - Extension e = new Extension(); - e.setUrl(uri); - e.setValue(value); - return e; - } - - public static CodeableConcept newCodeableConcept(String code, String system, String display) throws Exception { - CodeableConcept cc = new CodeableConcept(); - Coding c = new Coding(); - c.setCode(code); - c.setSystem(system); - c.setDisplay(display); - cc.getCoding().add(c); - return cc; - } - - public static Reference makeReference(String url) throws Exception { - Reference rr = new Reference(); - rr.setReference(url); - return rr; - } - - public static DateTimeType nowDateTime() { - DateTimeType dt = new DateTimeType(); - dt.setValue(DateAndTime.now()); - return dt; - } - -// public static Narrative newNarrative(NarrativeStatus status, String html) throws Exception { -// Narrative n = new Narrative(); -// n.setStatus(status); -// n.setDiv(new XhtmlParser().parseFragment("
      "+Utilities.escapeXml(html)+"
      ")); -// return n; -// } - - public InstantType nowInstant() { - InstantType instant = new InstantType(); - instant.setValue(DateAndTime.now()); - return instant; - } - -public static Coding makeCoding(String code) throws Exception { - String[] parts = code.split("\\|"); - Coding c = new Coding(); - if (parts.length == 2) { - c.setSystem(parts[0]); - c.setCode(parts[1]); - } else if (parts.length == 3) { - c.setSystem(parts[0]); - c.setCode(parts[1]); - c.setDisplay(parts[2]); - } else - throw new Exception("Unable to understand the code '"+code+"'. Use the format system|code(|display)"); - return c; -} - -} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FamilyHistory.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FamilyHistory.java index de7f4f65f20..8311e54acaf 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FamilyHistory.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FamilyHistory.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -816,14 +816,14 @@ public class FamilyHistory extends DomainResource { /** * @return The date (and possibly time) when the family history was taken. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date (and possibly time) when the family history was taken. */ - public FamilyHistory setDate(DateAndTime value) { + public FamilyHistory setDate(Date value) { if (value == null) this.date = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java new file mode 100644 index 00000000000..e64209779fc --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/FhirEnum.java @@ -0,0 +1,47 @@ +package org.hl7.fhir.instance.model; + + +/* +Copyright (c) 2011+, HL7, Inc +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +*/ + +/** + * Interface to be implemented by all built-in FHIR enumerations (i.e. the + * actual FHIR-defined Java Enum will implement this interface) + */ +public interface FhirEnum { + + /** + * Get the XML/JSON representation for an enumerated value + * @param code - the enumeration value + * @return the XML/JSON representation + * @throws Exception if the enumeration is not valid (would usually indicate a code generation bug) + */ + public String toCode(); + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Goal.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Goal.java new file mode 100644 index 00000000000..f3f68fa7dbb --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Goal.java @@ -0,0 +1,532 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * Describes the intended objective(s) of carrying out the Care Plan. + */ +@ResourceDef(name="Goal", profile="http://hl7.org/fhir/Profile/Goal") +public class Goal extends DomainResource { + + public enum GoalStatus implements FhirEnum { + /** + * The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again). + */ + INPROGRESS, + /** + * The goal has been met and no further action is needed. + */ + ACHIEVED, + /** + * The goal has been met, but ongoing activity is needed to sustain the goal objective. + */ + SUSTAINING, + /** + * The goal is no longer being sought. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + + public static final GoalStatusEnumFactory ENUM_FACTORY = new GoalStatusEnumFactory(); + + public static GoalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("achieved".equals(codeString)) + return ACHIEVED; + if ("sustaining".equals(codeString)) + return SUSTAINING; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new IllegalArgumentException("Unknown GoalStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case INPROGRESS: return "in progress"; + case ACHIEVED: return "achieved"; + case SUSTAINING: return "sustaining"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case ACHIEVED: return ""; + case SUSTAINING: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again)."; + case ACHIEVED: return "The goal has been met and no further action is needed."; + case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective."; + case CANCELLED: return "The goal is no longer being sought."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "in progress"; + case ACHIEVED: return "achieved"; + case SUSTAINING: return "sustaining"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + } + + public static class GoalStatusEnumFactory implements EnumFactory { + public GoalStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return GoalStatus.INPROGRESS; + if ("achieved".equals(codeString)) + return GoalStatus.ACHIEVED; + if ("sustaining".equals(codeString)) + return GoalStatus.SUSTAINING; + if ("cancelled".equals(codeString)) + return GoalStatus.CANCELLED; + throw new IllegalArgumentException("Unknown GoalStatus code '"+codeString+"'"); + } + public String toCode(GoalStatus code) throws IllegalArgumentException { + if (code == GoalStatus.INPROGRESS) + return "in progress"; + if (code == GoalStatus.ACHIEVED) + return "achieved"; + if (code == GoalStatus.SUSTAINING) + return "sustaining"; + if (code == GoalStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + /** + * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this goal", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * Identifies the patient/subject whose intended care is described by the plan. + */ + @Child(name="patient", type={Patient.class}, order=0, min=0, max=1) + @Description(shortDefinition="The patient for whom this goal is intended for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.) + */ + protected Patient patientTarget; + + /** + * Human-readable description of a specific desired objective of the care plan. + */ + @Child(name="description", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="What's the desired outcome?", formalDefinition="Human-readable description of a specific desired objective of the care plan." ) + protected StringType description; + + /** + * Indicates whether the goal has been reached and is still considered relevant. + */ + @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="in progress | achieved | sustaining | cancelled", formalDefinition="Indicates whether the goal has been reached and is still considered relevant." ) + protected Enumeration status; + + /** + * Any comments related to the goal. + */ + @Child(name="notes", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." ) + protected StringType notes; + + /** + * The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address. + */ + @Child(name="concern", type={Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Health issues this goal addresses", formalDefinition="The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address." ) + protected List concern; + /** + * The actual objects that are the target of the reference (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + protected List concernTarget; + + + private static final long serialVersionUID = -73791119L; + + public Goal() { + super(); + } + + public Goal(StringType description) { + super(); + this.description = description; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Goal setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Goal setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #description} (Human-readable description of a specific desired objective of the care plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Human-readable description of a specific desired objective of the care plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public Goal setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of a specific desired objective of the care plan. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of a specific desired objective of the care plan. + */ + public Goal setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Goal setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the goal has been reached and is still considered relevant. + */ + public GoalStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the goal has been reached and is still considered relevant. + */ + public Goal setStatus(GoalStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(GoalStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Goal.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public Goal setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Any comments related to the goal. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Any comments related to the goal. + */ + public Goal setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + /** + * @return {@link #concern} (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + public List getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + return this.concern; + } + + public boolean hasConcern() { + if (this.concern == null) + return false; + for (Reference item : this.concern) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concern} (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + // syntactic sugar + public Reference addConcern() { //3 + Reference t = new Reference(); + if (this.concern == null) + this.concern = new ArrayList(); + this.concern.add(t); + return t; + } + + /** + * @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + public List getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + return this.concernTarget; + } + + // syntactic sugar + /** + * @return {@link #concern} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + public Condition addConcernTarget() { + Condition r = new Condition(); + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + this.concernTarget.add(r); + return r; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("description", "string", "Human-readable description of a specific desired objective of the care plan.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("status", "code", "Indicates whether the goal has been reached and is still considered relevant.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("notes", "string", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("concern", "Reference(Condition)", "The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.", 0, java.lang.Integer.MAX_VALUE, concern)); + } + + public Goal copy() { + Goal dst = new Goal(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.description = description == null ? null : description.copy(); + dst.status = status == null ? null : status.copy(); + dst.notes = notes == null ? null : notes.copy(); + if (concern != null) { + dst.concern = new ArrayList(); + for (Reference i : concern) + dst.concern.add(i.copy()); + }; + return dst; + } + + protected Goal typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (description == null || description.isEmpty()) && (status == null || status.isEmpty()) + && (notes == null || notes.isEmpty()) && (concern == null || concern.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Goal; + } + + @SearchParamDefinition(name="patient", path="Goal.patient", description="The patient for whom this goal is intended for", type="reference" ) + public static final String SP_PATIENT = "patient"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/GoalRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/GoalRequest.java new file mode 100644 index 00000000000..d6c1455858c --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/GoalRequest.java @@ -0,0 +1,681 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * Describes the intended objective(s) of carrying out the Care Plan. + */ +@ResourceDef(name="GoalRequest", profile="http://hl7.org/fhir/Profile/GoalRequest") +public class GoalRequest extends DomainResource { + + public enum GoalRequestStatus implements FhirEnum { + /** + * The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again). + */ + INPROGRESS, + /** + * The goal has been met and no further action is needed. + */ + ACHIEVED, + /** + * The goal has been met, but ongoing activity is needed to sustain the goal objective. + */ + SUSTAINING, + /** + * The goal is no longer being sought. + */ + CANCELLED, + /** + * added to help the parsers + */ + NULL; + + public static final GoalRequestStatusEnumFactory ENUM_FACTORY = new GoalRequestStatusEnumFactory(); + + public static GoalRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return INPROGRESS; + if ("achieved".equals(codeString)) + return ACHIEVED; + if ("sustaining".equals(codeString)) + return SUSTAINING; + if ("cancelled".equals(codeString)) + return CANCELLED; + throw new IllegalArgumentException("Unknown GoalRequestStatus code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case INPROGRESS: return "in progress"; + case ACHIEVED: return "achieved"; + case SUSTAINING: return "sustaining"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case INPROGRESS: return ""; + case ACHIEVED: return ""; + case SUSTAINING: return ""; + case CANCELLED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case INPROGRESS: return "The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again)."; + case ACHIEVED: return "The goal has been met and no further action is needed."; + case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective."; + case CANCELLED: return "The goal is no longer being sought."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case INPROGRESS: return "in progress"; + case ACHIEVED: return "achieved"; + case SUSTAINING: return "sustaining"; + case CANCELLED: return "cancelled"; + default: return "?"; + } + } + } + + public static class GoalRequestStatusEnumFactory implements EnumFactory { + public GoalRequestStatus fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("in progress".equals(codeString)) + return GoalRequestStatus.INPROGRESS; + if ("achieved".equals(codeString)) + return GoalRequestStatus.ACHIEVED; + if ("sustaining".equals(codeString)) + return GoalRequestStatus.SUSTAINING; + if ("cancelled".equals(codeString)) + return GoalRequestStatus.CANCELLED; + throw new IllegalArgumentException("Unknown GoalRequestStatus code '"+codeString+"'"); + } + public String toCode(GoalRequestStatus code) throws IllegalArgumentException { + if (code == GoalRequestStatus.INPROGRESS) + return "in progress"; + if (code == GoalRequestStatus.ACHIEVED) + return "achieved"; + if (code == GoalRequestStatus.SUSTAINING) + return "sustaining"; + if (code == GoalRequestStatus.CANCELLED) + return "cancelled"; + return "?"; + } + } + + public enum GoalRequestMode implements FhirEnum { + /** + * planned. + */ + PLANNED, + /** + * proposed. + */ + PROPOSED, + /** + * ordered. + */ + ORDERED, + /** + * added to help the parsers + */ + NULL; + + public static final GoalRequestModeEnumFactory ENUM_FACTORY = new GoalRequestModeEnumFactory(); + + public static GoalRequestMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return PLANNED; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("ordered".equals(codeString)) + return ORDERED; + throw new IllegalArgumentException("Unknown GoalRequestMode code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case PLANNED: return "planned"; + case PROPOSED: return "proposed"; + case ORDERED: return "ordered"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case PLANNED: return ""; + case PROPOSED: return ""; + case ORDERED: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case PLANNED: return "planned."; + case PROPOSED: return "proposed."; + case ORDERED: return "ordered."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case PLANNED: return "planned"; + case PROPOSED: return "proposed"; + case ORDERED: return "ordered"; + default: return "?"; + } + } + } + + public static class GoalRequestModeEnumFactory implements EnumFactory { + public GoalRequestMode fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("planned".equals(codeString)) + return GoalRequestMode.PLANNED; + if ("proposed".equals(codeString)) + return GoalRequestMode.PROPOSED; + if ("ordered".equals(codeString)) + return GoalRequestMode.ORDERED; + throw new IllegalArgumentException("Unknown GoalRequestMode code '"+codeString+"'"); + } + public String toCode(GoalRequestMode code) throws IllegalArgumentException { + if (code == GoalRequestMode.PLANNED) + return "planned"; + if (code == GoalRequestMode.PROPOSED) + return "proposed"; + if (code == GoalRequestMode.ORDERED) + return "ordered"; + return "?"; + } + } + + /** + * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="External Ids for this goal", formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." ) + protected List identifier; + + /** + * Identifies the patient/subject whose intended care is described by the plan. + */ + @Child(name="patient", type={Patient.class}, order=0, min=0, max=1) + @Description(shortDefinition="The patient for whom this goal is intended for", formalDefinition="Identifies the patient/subject whose intended care is described by the plan." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Identifies the patient/subject whose intended care is described by the plan.) + */ + protected Patient patientTarget; + + /** + * Human-readable description of a specific desired objective of the care plan. + */ + @Child(name="description", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="What's the desired outcome?", formalDefinition="Human-readable description of a specific desired objective of the care plan." ) + protected StringType description; + + /** + * Indicates whether the goal has been reached and is still considered relevant. + */ + @Child(name="status", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="in progress | achieved | sustaining | cancelled", formalDefinition="Indicates whether the goal has been reached and is still considered relevant." ) + protected Enumeration status; + + /** + * Any comments related to the goal. + */ + @Child(name="notes", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." ) + protected StringType notes; + + /** + * The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address. + */ + @Child(name="concern", type={Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Health issues this goal addresses", formalDefinition="The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address." ) + protected List concern; + /** + * The actual objects that are the target of the reference (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + protected List concernTarget; + + + /** + * The status of the order. + */ + @Child(name="mode", type={CodeType.class}, order=5, min=0, max=1) + @Description(shortDefinition="planned | proposed | ordered", formalDefinition="The status of the order." ) + protected Enumeration mode; + + private static final long serialVersionUID = 1698507147L; + + public GoalRequest() { + super(); + } + + public GoalRequest(StringType description) { + super(); + this.description = description; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GoalRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Identifies the patient/subject whose intended care is described by the plan.) + */ + public GoalRequest setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GoalRequest.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient/subject whose intended care is described by the plan.) + */ + public GoalRequest setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #description} (Human-readable description of a specific desired objective of the care plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public StringType getDescriptionElement() { + if (this.description == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GoalRequest.description"); + else if (Configuration.doAutoCreate()) + this.description = new StringType(); + return this.description; + } + + public boolean hasDescriptionElement() { + return this.description != null && !this.description.isEmpty(); + } + + public boolean hasDescription() { + return this.description != null && !this.description.isEmpty(); + } + + /** + * @param value {@link #description} (Human-readable description of a specific desired objective of the care plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + */ + public GoalRequest setDescriptionElement(StringType value) { + this.description = value; + return this; + } + + /** + * @return Human-readable description of a specific desired objective of the care plan. + */ + public String getDescription() { + return this.description == null ? null : this.description.getValue(); + } + + /** + * @param value Human-readable description of a specific desired objective of the care plan. + */ + public GoalRequest setDescription(String value) { + if (this.description == null) + this.description = new StringType(); + this.description.setValue(value); + return this; + } + + /** + * @return {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public Enumeration getStatusElement() { + if (this.status == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GoalRequest.status"); + else if (Configuration.doAutoCreate()) + this.status = new Enumeration(); + return this.status; + } + + public boolean hasStatusElement() { + return this.status != null && !this.status.isEmpty(); + } + + public boolean hasStatus() { + return this.status != null && !this.status.isEmpty(); + } + + /** + * @param value {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value + */ + public GoalRequest setStatusElement(Enumeration value) { + this.status = value; + return this; + } + + /** + * @return Indicates whether the goal has been reached and is still considered relevant. + */ + public GoalRequestStatus getStatus() { + return this.status == null ? null : this.status.getValue(); + } + + /** + * @param value Indicates whether the goal has been reached and is still considered relevant. + */ + public GoalRequest setStatus(GoalRequestStatus value) { + if (value == null) + this.status = null; + else { + if (this.status == null) + this.status = new Enumeration(GoalRequestStatus.ENUM_FACTORY); + this.status.setValue(value); + } + return this; + } + + /** + * @return {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public StringType getNotesElement() { + if (this.notes == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GoalRequest.notes"); + else if (Configuration.doAutoCreate()) + this.notes = new StringType(); + return this.notes; + } + + public boolean hasNotesElement() { + return this.notes != null && !this.notes.isEmpty(); + } + + public boolean hasNotes() { + return this.notes != null && !this.notes.isEmpty(); + } + + /** + * @param value {@link #notes} (Any comments related to the goal.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value + */ + public GoalRequest setNotesElement(StringType value) { + this.notes = value; + return this; + } + + /** + * @return Any comments related to the goal. + */ + public String getNotes() { + return this.notes == null ? null : this.notes.getValue(); + } + + /** + * @param value Any comments related to the goal. + */ + public GoalRequest setNotes(String value) { + if (Utilities.noString(value)) + this.notes = null; + else { + if (this.notes == null) + this.notes = new StringType(); + this.notes.setValue(value); + } + return this; + } + + /** + * @return {@link #concern} (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + public List getConcern() { + if (this.concern == null) + this.concern = new ArrayList(); + return this.concern; + } + + public boolean hasConcern() { + if (this.concern == null) + return false; + for (Reference item : this.concern) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #concern} (The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + // syntactic sugar + public Reference addConcern() { //3 + Reference t = new Reference(); + if (this.concern == null) + this.concern = new ArrayList(); + this.concern.add(t); + return t; + } + + /** + * @return {@link #concern} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + public List getConcernTarget() { + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + return this.concernTarget; + } + + // syntactic sugar + /** + * @return {@link #concern} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.) + */ + public Condition addConcernTarget() { + Condition r = new Condition(); + if (this.concernTarget == null) + this.concernTarget = new ArrayList(); + this.concernTarget.add(r); + return r; + } + + /** + * @return {@link #mode} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public Enumeration getModeElement() { + if (this.mode == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create GoalRequest.mode"); + else if (Configuration.doAutoCreate()) + this.mode = new Enumeration(); + return this.mode; + } + + public boolean hasModeElement() { + return this.mode != null && !this.mode.isEmpty(); + } + + public boolean hasMode() { + return this.mode != null && !this.mode.isEmpty(); + } + + /** + * @param value {@link #mode} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value + */ + public GoalRequest setModeElement(Enumeration value) { + this.mode = value; + return this; + } + + /** + * @return The status of the order. + */ + public GoalRequestMode getMode() { + return this.mode == null ? null : this.mode.getValue(); + } + + /** + * @param value The status of the order. + */ + public GoalRequest setMode(GoalRequestMode value) { + if (value == null) + this.mode = null; + else { + if (this.mode == null) + this.mode = new Enumeration(GoalRequestMode.ENUM_FACTORY); + this.mode.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("patient", "Reference(Patient)", "Identifies the patient/subject whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("description", "string", "Human-readable description of a specific desired objective of the care plan.", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("status", "code", "Indicates whether the goal has been reached and is still considered relevant.", 0, java.lang.Integer.MAX_VALUE, status)); + childrenList.add(new Property("notes", "string", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, notes)); + childrenList.add(new Property("concern", "Reference(Condition)", "The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address.", 0, java.lang.Integer.MAX_VALUE, concern)); + childrenList.add(new Property("mode", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, mode)); + } + + public GoalRequest copy() { + GoalRequest dst = new GoalRequest(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + dst.description = description == null ? null : description.copy(); + dst.status = status == null ? null : status.copy(); + dst.notes = notes == null ? null : notes.copy(); + if (concern != null) { + dst.concern = new ArrayList(); + for (Reference i : concern) + dst.concern.add(i.copy()); + }; + dst.mode = mode == null ? null : mode.copy(); + return dst; + } + + protected GoalRequest typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) + && (description == null || description.isEmpty()) && (status == null || status.isEmpty()) + && (notes == null || notes.isEmpty()) && (concern == null || concern.isEmpty()) && (mode == null || mode.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.GoalRequest; + } + + @SearchParamDefinition(name="patient", path="GoalRequest.patient", description="The patient for whom this goal is intended for", type="reference" ) + public static final String SP_PATIENT = "patient"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Group.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Group.java index 81fd041acdf..ca3ea0ded89 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Group.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Group.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Group", profile="http://hl7.org/fhir/Profile/Group") public class Group extends DomainResource { - public enum GroupType { + public enum GroupType implements FhirEnum { /** * Group contains "person" Patient resources. */ @@ -74,7 +74,10 @@ public class Group extends DomainResource { * added to help the parsers */ NULL; - public static GroupType fromCode(String codeString) throws Exception { + + public static final GroupTypeEnumFactory ENUM_FACTORY = new GroupTypeEnumFactory(); + + public static GroupType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("person".equals(codeString)) @@ -89,8 +92,9 @@ public class Group extends DomainResource { return MEDICATION; if ("substance".equals(codeString)) return SUBSTANCE; - throw new Exception("Unknown GroupType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PERSON: return "person"; @@ -137,8 +141,8 @@ public class Group extends DomainResource { } } - public static class GroupTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class GroupTypeEnumFactory implements EnumFactory { + public GroupType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -154,9 +158,9 @@ public class Group extends DomainResource { return GroupType.MEDICATION; if ("substance".equals(codeString)) return GroupType.SUBSTANCE; - throw new Exception("Unknown GroupType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(GroupType code) throws IllegalArgumentException { if (code == GroupType.PERSON) return "person"; if (code == GroupType.ANIMAL) @@ -493,7 +497,7 @@ public class Group extends DomainResource { */ public Group setType(GroupType value) { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(GroupType.ENUM_FACTORY); this.type.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java index 6ed6f6a9fe7..e33d2c1b871 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HealthcareService.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -297,14 +297,14 @@ public class HealthcareService extends DomainResource { /** * @return The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. */ - public DateAndTime getAvailableStartTime() { + public Date getAvailableStartTime() { return this.availableStartTime == null ? null : this.availableStartTime.getValue(); } /** * @param value The opening time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. */ - public HealthcareServiceAvailableTimeComponent setAvailableStartTime(DateAndTime value) { + public HealthcareServiceAvailableTimeComponent setAvailableStartTime(Date value) { if (value == null) this.availableStartTime = null; else { @@ -346,14 +346,14 @@ public class HealthcareService extends DomainResource { /** * @return The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. */ - public DateAndTime getAvailableEndTime() { + public Date getAvailableEndTime() { return this.availableEndTime == null ? null : this.availableEndTime.getValue(); } /** * @param value The closing time of day (the date is not included). Note: If the AllDay flag is set, then this time is ignored. */ - public HealthcareServiceAvailableTimeComponent setAvailableEndTime(DateAndTime value) { + public HealthcareServiceAvailableTimeComponent setAvailableEndTime(Date value) { if (value == null) this.availableEndTime = null; else { @@ -504,14 +504,14 @@ public class HealthcareService extends DomainResource { /** * @return Service is not available (seasonally or for a public holiday) from this date. */ - public DateAndTime getStartDate() { + public Date getStartDate() { return this.startDate == null ? null : this.startDate.getValue(); } /** * @param value Service is not available (seasonally or for a public holiday) from this date. */ - public HealthcareServiceNotAvailableTimeComponent setStartDate(DateAndTime value) { + public HealthcareServiceNotAvailableTimeComponent setStartDate(Date value) { if (value == null) this.startDate = null; else { @@ -553,14 +553,14 @@ public class HealthcareService extends DomainResource { /** * @return Service is not available (seasonally or for a public holiday) until this date. */ - public DateAndTime getEndDate() { + public Date getEndDate() { return this.endDate == null ? null : this.endDate.getValue(); } /** * @param value Service is not available (seasonally or for a public holiday) until this date. */ - public HealthcareServiceNotAvailableTimeComponent setEndDate(DateAndTime value) { + public HealthcareServiceNotAvailableTimeComponent setEndDate(Date value) { if (value == null) this.endDate = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HumanName.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HumanName.java index 7fa5c58938c..456707e8d4d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HumanName.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/HumanName.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef; @DatatypeDef(name="HumanName") public class HumanName extends Type { - public enum NameUse { + public enum NameUse implements FhirEnum { /** * Known as/conventional/the one you normally use. */ @@ -76,7 +76,10 @@ public class HumanName extends Type { * added to help the parsers */ NULL; - public static NameUse fromCode(String codeString) throws Exception { + + public static final NameUseEnumFactory ENUM_FACTORY = new NameUseEnumFactory(); + + public static NameUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("usual".equals(codeString)) @@ -93,8 +96,9 @@ public class HumanName extends Type { return OLD; if ("maiden".equals(codeString)) return MAIDEN; - throw new Exception("Unknown NameUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case USUAL: return "usual"; @@ -145,8 +149,8 @@ public class HumanName extends Type { } } - public static class NameUseEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class NameUseEnumFactory implements EnumFactory { + public NameUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -164,9 +168,9 @@ public class HumanName extends Type { return NameUse.OLD; if ("maiden".equals(codeString)) return NameUse.MAIDEN; - throw new Exception("Unknown NameUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NameUse code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(NameUse code) throws IllegalArgumentException { if (code == NameUse.USUAL) return "usual"; if (code == NameUse.OFFICIAL) @@ -283,7 +287,7 @@ public class HumanName extends Type { this.use = null; else { if (this.use == null) - this.use = new Enumeration(); + this.use = new Enumeration(NameUse.ENUM_FACTORY); this.use.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IdType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IdType.java index 35bd97265ee..5a46caa7ac1 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IdType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IdType.java @@ -29,62 +29,41 @@ POSSIBILITY OF SUCH DAMAGE. package org.hl7.fhir.instance.model; /** - * Primitive type "id" in FHIR: a string from 1 to 36 characters, only containing letters, digits, "-" and "." + * Primitive type "id" in FHIR: a string from 1 to 64 characters, only containing letters, digits, "-" and "." */ -public class IdType extends PrimitiveType { +public class IdType extends PrimitiveType { - private static final long serialVersionUID = 8363122970864385593L; + public static final int MAX_LENGTH = 64; + + private static final long serialVersionUID = 1L; - public static final int MAX_LENGTH = 64; - /** - * The value of the id + * Constructor */ - protected String value; - - public IdType(String value) { - this.value = value; - } - - public IdType() { - } - - /** - * @return the id - */ - public String getValue() { - return value; + public IdType() { + super(); } /** - * @param value the id + * Constructor */ - public void setValue(String value) { - this.value = value; - } - - @Override - protected Type typedCopy() { - return copy(); - } - - @Override - public IdType copy() { - IdType dst = new IdType(); - dst.value = value; - return dst; + public IdType(String theValue) { + setValue(theValue); } - @Override - public String asStringValue() { - return value; - } - public boolean isEmpty() { - return super.isEmpty() && value == null; + @Override + protected String parse(String theValue) { + return theValue; } - public boolean hasValue() { - return value != null; + @Override + protected String encode(String theValue) { + return theValue; } - -} + + @Override + public IdType copy() { + return new IdType(getValue()); + } + +} \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Identifier.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Identifier.java index f84d2ad216c..7d191986f73 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Identifier.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Identifier.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -43,7 +43,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef; @DatatypeDef(name="Identifier") public class Identifier extends Type { - public enum IdentifierUse { + public enum IdentifierUse implements FhirEnum { /** * the identifier recommended for display and use in real-world interactions. */ @@ -64,7 +64,10 @@ public class Identifier extends Type { * added to help the parsers */ NULL; - public static IdentifierUse fromCode(String codeString) throws Exception { + + public static final IdentifierUseEnumFactory ENUM_FACTORY = new IdentifierUseEnumFactory(); + + public static IdentifierUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("usual".equals(codeString)) @@ -75,8 +78,9 @@ public class Identifier extends Type { return TEMP; if ("secondary".equals(codeString)) return SECONDARY; - throw new Exception("Unknown IdentifierUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case USUAL: return "usual"; @@ -115,8 +119,8 @@ public class Identifier extends Type { } } - public static class IdentifierUseEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class IdentifierUseEnumFactory implements EnumFactory { + public IdentifierUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -128,9 +132,9 @@ public class Identifier extends Type { return IdentifierUse.TEMP; if ("secondary".equals(codeString)) return IdentifierUse.SECONDARY; - throw new Exception("Unknown IdentifierUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(IdentifierUse code) throws IllegalArgumentException { if (code == IdentifierUse.USUAL) return "usual"; if (code == IdentifierUse.OFFICIAL) @@ -239,7 +243,7 @@ public class Identifier extends Type { this.use = null; else { if (this.use == null) - this.use = new Enumeration(); + this.use = new Enumeration(IdentifierUse.ENUM_FACTORY); this.use.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java index 2e31649098f..fc0a7a3ee82 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingObjectSelection.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -1103,14 +1103,14 @@ Note that this AE Title is provided to retrieve all SOP instances of the series /** * @return Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource. */ - public DateAndTime getAuthoringTime() { + public Date getAuthoringTime() { return this.authoringTime == null ? null : this.authoringTime.getValue(); } /** * @param value Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource. */ - public ImagingObjectSelection setAuthoringTime(DateAndTime value) { + public ImagingObjectSelection setAuthoringTime(Date value) { if (value == null) this.authoringTime = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java index b7adfef02e6..f36286fe571 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImagingStudy.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="ImagingStudy", profile="http://hl7.org/fhir/Profile/ImagingStudy") public class ImagingStudy extends DomainResource { - public enum ImagingModality { + public enum ImagingModality implements FhirEnum { /** * */ @@ -194,7 +194,10 @@ public class ImagingStudy extends DomainResource { * added to help the parsers */ NULL; - public static ImagingModality fromCode(String codeString) throws Exception { + + public static final ImagingModalityEnumFactory ENUM_FACTORY = new ImagingModalityEnumFactory(); + + public static ImagingModality fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("AR".equals(codeString)) @@ -269,8 +272,9 @@ public class ImagingStudy extends DomainResource { return VA; if ("XA".equals(codeString)) return XA; - throw new Exception("Unknown ImagingModality code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case AR: return "AR"; @@ -437,8 +441,8 @@ public class ImagingStudy extends DomainResource { } } - public static class ImagingModalityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ImagingModalityEnumFactory implements EnumFactory { + public ImagingModality fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -514,9 +518,9 @@ public class ImagingStudy extends DomainResource { return ImagingModality.VA; if ("XA".equals(codeString)) return ImagingModality.XA; - throw new Exception("Unknown ImagingModality code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ImagingModality code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ImagingModality code) throws IllegalArgumentException { if (code == ImagingModality.AR) return "AR"; if (code == ImagingModality.BMD) @@ -593,7 +597,7 @@ public class ImagingStudy extends DomainResource { } } - public enum InstanceAvailability { + public enum InstanceAvailability implements FhirEnum { /** * Resources are immediately available,. */ @@ -614,7 +618,10 @@ public class ImagingStudy extends DomainResource { * added to help the parsers */ NULL; - public static InstanceAvailability fromCode(String codeString) throws Exception { + + public static final InstanceAvailabilityEnumFactory ENUM_FACTORY = new InstanceAvailabilityEnumFactory(); + + public static InstanceAvailability fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("ONLINE".equals(codeString)) @@ -625,8 +632,9 @@ public class ImagingStudy extends DomainResource { return NEARLINE; if ("UNAVAILABLE".equals(codeString)) return UNAVAILABLE; - throw new Exception("Unknown InstanceAvailability code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ONLINE: return "ONLINE"; @@ -665,8 +673,8 @@ public class ImagingStudy extends DomainResource { } } - public static class InstanceAvailabilityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class InstanceAvailabilityEnumFactory implements EnumFactory { + public InstanceAvailability fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -678,9 +686,9 @@ public class ImagingStudy extends DomainResource { return InstanceAvailability.NEARLINE; if ("UNAVAILABLE".equals(codeString)) return InstanceAvailability.UNAVAILABLE; - throw new Exception("Unknown InstanceAvailability code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(InstanceAvailability code) throws IllegalArgumentException { if (code == InstanceAvailability.ONLINE) return "ONLINE"; if (code == InstanceAvailability.OFFLINE) @@ -693,7 +701,7 @@ public class ImagingStudy extends DomainResource { } } - public enum Modality { + public enum Modality implements FhirEnum { /** * */ @@ -910,7 +918,10 @@ public class ImagingStudy extends DomainResource { * added to help the parsers */ NULL; - public static Modality fromCode(String codeString) throws Exception { + + public static final ModalityEnumFactory ENUM_FACTORY = new ModalityEnumFactory(); + + public static Modality fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("AR".equals(codeString)) @@ -1019,8 +1030,9 @@ public class ImagingStudy extends DomainResource { return XA; if ("XC".equals(codeString)) return XC; - throw new Exception("Unknown Modality code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case AR: return "AR"; @@ -1255,8 +1267,8 @@ public class ImagingStudy extends DomainResource { } } - public static class ModalityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ModalityEnumFactory implements EnumFactory { + public Modality fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -1366,9 +1378,9 @@ public class ImagingStudy extends DomainResource { return Modality.XA; if ("XC".equals(codeString)) return Modality.XC; - throw new Exception("Unknown Modality code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Modality code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(Modality code) throws IllegalArgumentException { if (code == Modality.AR) return "AR"; if (code == Modality.AU) @@ -1653,7 +1665,7 @@ public class ImagingStudy extends DomainResource { */ public ImagingStudySeriesComponent setModality(Modality value) { if (this.modality == null) - this.modality = new Enumeration(); + this.modality = new Enumeration(Modality.ENUM_FACTORY); this.modality.setValue(value); return this; } @@ -1840,7 +1852,7 @@ public class ImagingStudy extends DomainResource { this.availability = null; else { if (this.availability == null) - this.availability = new Enumeration(); + this.availability = new Enumeration(InstanceAvailability.ENUM_FACTORY); this.availability.setValue(value); } return this; @@ -1950,14 +1962,14 @@ public class ImagingStudy extends DomainResource { /** * @return The date when the series was started. */ - public DateAndTime getDateTime() { + public Date getDateTime() { return this.dateTime == null ? null : this.dateTime.getValue(); } /** * @param value The date when the series was started. */ - public ImagingStudySeriesComponent setDateTime(DateAndTime value) { + public ImagingStudySeriesComponent setDateTime(Date value) { if (value == null) this.dateTime = null; else { @@ -2650,14 +2662,14 @@ public class ImagingStudy extends DomainResource { /** * @return Date and Time the study started. */ - public DateAndTime getStarted() { + public Date getStarted() { return this.started == null ? null : this.started.getValue(); } /** * @param value Date and Time the study started. */ - public ImagingStudy setStarted(DateAndTime value) { + public ImagingStudy setStarted(Date value) { if (value == null) this.started = null; else { @@ -3003,7 +3015,7 @@ public class ImagingStudy extends DomainResource { this.availability = null; else { if (this.availability == null) - this.availability = new Enumeration(); + this.availability = new Enumeration(InstanceAvailability.ENUM_FACTORY); this.availability.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Immunization.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Immunization.java index 8505e65d54d..b56fa6d53c7 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Immunization.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Immunization.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -221,14 +221,14 @@ public class Immunization extends DomainResource { /** * @return Date of reaction to the immunization. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value Date of reaction to the immunization. */ - public ImmunizationReactionComponent setDate(DateAndTime value) { + public ImmunizationReactionComponent setDate(Date value) { if (value == null) this.date = null; else { @@ -1001,14 +1001,14 @@ public class Immunization extends DomainResource { /** * @return Date vaccine administered or was to be administered. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value Date vaccine administered or was to be administered. */ - public Immunization setDate(DateAndTime value) { + public Immunization setDate(Date value) { if (this.date == null) this.date = new DateTimeType(); this.date.setValue(value); @@ -1429,14 +1429,14 @@ public class Immunization extends DomainResource { /** * @return Date vaccine batch expires. */ - public DateAndTime getExpirationDate() { + public Date getExpirationDate() { return this.expirationDate == null ? null : this.expirationDate.getValue(); } /** * @param value Date vaccine batch expires. */ - public Immunization setExpirationDate(DateAndTime value) { + public Immunization setExpirationDate(Date value) { if (value == null) this.expirationDate = null; else { @@ -1684,10 +1684,10 @@ public class Immunization extends DomainResource { @SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="Additional information on reaction", type="reference" ) public static final String SP_REACTION = "reaction"; - @SearchParamDefinition(name="dose-sequence", path="Immunization.vaccinationProtocol.doseSequence", description="What dose number within series?", type="number" ) - public static final String SP_DOSESEQUENCE = "dose-sequence"; @SearchParamDefinition(name="requester", path="Immunization.requester", description="The practitioner who ordered the vaccination", type="reference" ) public static final String SP_REQUESTER = "requester"; + @SearchParamDefinition(name="dose-sequence", path="Immunization.vaccinationProtocol.doseSequence", description="What dose number within series?", type="number" ) + public static final String SP_DOSESEQUENCE = "dose-sequence"; @SearchParamDefinition(name="vaccine-type", path="Immunization.vaccineType", description="Vaccine Product Type Administered", type="token" ) public static final String SP_VACCINETYPE = "vaccine-type"; @SearchParamDefinition(name="location", path="Immunization.location", description="The service delivery location or facility in which the vaccine was / was to be administered", type="reference" ) diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java index 7cef1f1376a..73677cd21fd 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ImmunizationRecommendation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -157,14 +157,14 @@ public class ImmunizationRecommendation extends DomainResource { /** * @return The date the immunization recommendation was created. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date the immunization recommendation was created. */ - public ImmunizationRecommendationRecommendationComponent setDate(DateAndTime value) { + public ImmunizationRecommendationRecommendationComponent setDate(Date value) { if (this.date == null) this.date = new DateTimeType(); this.date.setValue(value); @@ -543,14 +543,14 @@ public class ImmunizationRecommendation extends DomainResource { /** * @return Date recommendation. */ - public DateAndTime getValue() { + public Date getValue() { return this.value == null ? null : this.value.getValue(); } /** * @param value Date recommendation. */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(DateAndTime value) { + public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(Date value) { if (this.value == null) this.value = new DateTimeType(); this.value.setValue(value); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstantType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstantType.java index 8eb6f95bbe0..fbd92a2319c 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstantType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstantType.java @@ -34,8 +34,7 @@ package org.hl7.fhir.instance.model; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; - -import ca.uhn.fhir.parser.DataFormatException; +import java.util.zip.DataFormatException; /** * Represents a FHIR instant datatype. Valid precisions values for this type are: @@ -46,6 +45,8 @@ import ca.uhn.fhir.parser.DataFormatException; */ public class InstantType extends BaseDateTimeType { + private static final long serialVersionUID = 1L; + /** * The default precision for this type */ @@ -195,4 +196,22 @@ public class InstantType extends BaseDateTimeType { public InstantType copy() { return new InstantType(getValue()); } + + /** + * Returns a new instance of DateTimeType with the current system time and MILLI precision and the system local time + * zone + */ + public static InstantType now() { + return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); + } + + /** + * Creates a new instance by parsing an HL7 v3 format date time string + */ + public static InstantType parseV3(String theV3String) { + InstantType retVal = new InstantType(); + retVal.setValueAsV3String(theV3String); + return retVal; + } + } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstitutionalClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstitutionalClaim.java new file mode 100644 index 00000000000..bb64b7252e3 --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/InstitutionalClaim.java @@ -0,0 +1,3786 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import java.math.*; +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="InstitutionalClaim", profile="http://hl7.org/fhir/Profile/InstitutionalClaim") +public class InstitutionalClaim extends DomainResource { + + public enum UseLink implements FhirEnum { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + public static final UseLinkEnumFactory ENUM_FACTORY = new UseLinkEnumFactory(); + + public static UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) throws IllegalArgumentException { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement { + /** + * Sequence of diagnosis. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) + protected IntegerType sequence; + + /** + * The diagnosis. + */ + @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -935927954L; + + public DiagnosisComponent() { + super(); + } + + public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agrement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preauthref; + + /** + * The Coverages adjudication details. + */ + @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + private static final long serialVersionUID = 450222500L; + + public CoverageComponent() { + super(); + } + + public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agrement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agrement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreauthref() { + if (this.preauthref == null) + this.preauthref = new ArrayList(); + return this.preauthref; + } + + public boolean hasPreauthref() { + if (this.preauthref == null) + return false; + for (StringType item : this.preauthref) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreauthrefElement() {//2 + StringType t = new StringType(); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return t; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreauthref(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return this; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreauthref(String value) { + if (this.preauthref == null) + return false; + for (StringType v : this.preauthref) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preauthref != null) { + dst.preauthref = new ArrayList(); + for (StringType i : preauthref) + dst.preauthref.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * Diagnosis applicable for this service or product line. + */ + @Child(name="diagnosisLinkId", type={IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis Link", formalDefinition="Diagnosis applicable for this service or product line." ) + protected List diagnosisLinkId; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied." ) + protected Coding service; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name="serviceDate", type={DateType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Date of Service", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateType serviceDate; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name="unitPrice", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=11, min=0, max=1) + @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=12, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Physical service site on the patient (limb, tooth, etc). + */ + @Child(name="bodySite", type={Coding.class}, order=13, min=0, max=1) + @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) + protected Coding bodySite; + + /** + * A region or surface of the site, eg. limb region or tooth surface(s). + */ + @Child(name="subsite", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) + protected List subsite; + + /** + * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. + */ + @Child(name="modifier", type={Coding.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." ) + protected List modifier; + + /** + * Second tier of goods and services. + */ + @Child(name="detail", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." ) + protected List detail; + + private static final long serialVersionUID = -1140048455L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + return this.diagnosisLinkId; + } + + public boolean hasDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType item : this.diagnosisLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + // syntactic sugar + public IntegerType addDiagnosisLinkIdElement() {//2 + IntegerType t = new IntegerType(); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return t; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public ItemsComponent addDiagnosisLinkId(int value) { //1 + IntegerType t = new IntegerType(); + t.setValue(value); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return this; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public boolean hasDiagnosisLinkId(int value) { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType v : this.diagnosisLinkId) + if (v.equals(value)) // integer + return true; + return false; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getServiceDate() { + return this.serviceDate == null ? null : this.serviceDate.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public ItemsComponent setServiceDate(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubsite() { + if (this.subsite == null) + this.subsite = new ArrayList(); + return this.subsite; + } + + public boolean hasSubsite() { + if (this.subsite == null) + return false; + for (Coding item : this.subsite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubsite() { //3 + Coding t = new Coding(); + if (this.subsite == null) + this.subsite = new ArrayList(); + this.subsite.add(t); + return t; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("diagnosisLinkId", "integer", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("serviceDate", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviceDate)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + if (diagnosisLinkId != null) { + dst.diagnosisLinkId = new ArrayList(); + for (IntegerType i : diagnosisLinkId) + dst.diagnosisLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + dst.serviceDate = serviceDate == null ? null : serviceDate.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subsite != null) { + dst.subsite = new ArrayList(); + for (Coding i : subsite) + dst.subsite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (provider == null || provider.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) + && (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (subsite == null || subsite.isEmpty()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class DetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -342502025L; + + public DetailComponent() { + super(); + } + + public DetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Institutional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = 122809194L; + + public SubDetailComponent() { + super(); + } + + public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addtional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()); + } + + } + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name="facility", type={Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Theparty to be reimbused for the services. + */ + @Child(name="payee", type={}, order=11, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name="school", type={StringType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addessing. + */ + @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * First tier of goods and services. + */ + @Child(name="item", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name="additionalMaterials", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional materials, documents, etc.", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." ) + protected List additionalMaterials; + + private static final long serialVersionUID = 1113876752L; + + public InstitutionalClaim() { + super(); + } + + public InstitutionalClaim(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public InstitutionalClaim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public InstitutionalClaim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public InstitutionalClaim setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public InstitutionalClaim setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public InstitutionalClaim setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) + */ + public InstitutionalClaim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public InstitutionalClaim setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public InstitutionalClaim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public InstitutionalClaim setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public InstitutionalClaim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public InstitutionalClaim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public InstitutionalClaim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(UseLink.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public InstitutionalClaim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public InstitutionalClaim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public InstitutionalClaim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public InstitutionalClaim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public InstitutionalClaim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); + return this.facilityTarget; + } + + /** + * @param value {@link #facility} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public InstitutionalClaim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #payee} (Theparty to be reimbused for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Theparty to be reimbused for the services.) + */ + public InstitutionalClaim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public InstitutionalClaim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public InstitutionalClaim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient Resource.) + */ + public InstitutionalClaim setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public InstitutionalClaim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public InstitutionalClaim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public InstitutionalClaim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public InstitutionalClaim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addessing. + */ + public Date getAccident() { + return this.accident == null ? null : this.accident.getValue(); + } + + /** + * @param value Date of an accident which these services are addessing. + */ + public InstitutionalClaim setAccident(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create InstitutionalClaim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public InstitutionalClaim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + } + + public InstitutionalClaim copy() { + InstitutionalClaim dst = new InstitutionalClaim(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.target = target == null ? null : target.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + return dst; + } + + protected InstitutionalClaim typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) && (fundsReserve == null || fundsReserve.isEmpty()) + && (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) && (payee == null || payee.isEmpty()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.InstitutionalClaim; + } + + @SearchParamDefinition(name="patient", path="InstitutionalClaim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="InstitutionalClaim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="use", path="InstitutionalClaim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="identifier", path="InstitutionalClaim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IntegerType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IntegerType.java index 3616c02c231..2ad8bb9c770 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IntegerType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/IntegerType.java @@ -25,96 +25,81 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + */ /** * */ package org.hl7.fhir.instance.model; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + /** - * Primitive type "integer" in FHIR: A signed 32-bit integer - * @author Grahame - * + * Primitive type "integer" in FHIR: A signed 32-bit integer */ -public class IntegerType extends PrimitiveType { +@DatatypeDef(name = "integer") +public class IntegerType extends PrimitiveType { + + private static final long serialVersionUID = 1L; - private static final long serialVersionUID = -553171308047944356L; /** - * the actual value of the number + * Constructor */ - private java.lang.Integer value; - /** - * The exact representation of the number on the wire. i.e. does it have leading zeros. - * This SHOULD not be used, but is provided in case it's absolutely needed - */ - private String original; - - public IntegerType(Integer value) { - if (value != null) { - this.value = value; - original = value.toString(); - } - } - - public IntegerType() { - } - - /** - * @return the integer value - */ - public int getValue() { - return value; + public IntegerType() { + // nothing } /** - * @param value the integer value + * Constructor */ - public void setValue(int value) { - this.value = value; - this.original = null; + public IntegerType(int theInteger) { + setValue(theInteger); } /** - * @return The exact representation of the number on the wire + * Constructor + * + * @param theIntegerAsString + * A string representation of an integer + * @throws IllegalArgumentException + * If the string is not a valid integer representation */ - public String getOriginal() { - return original; - } + public IntegerType(String theIntegerAsString) { + setValueAsString(theIntegerAsString); + } + + /** + * Constructor + * + * @param theValue The value + * @throws IllegalArgumentException If the value is too large to fit in a signed integer + */ + public IntegerType(Long theValue) { + if (theValue < java.lang.Integer.MIN_VALUE || theValue > java.lang.Integer.MAX_VALUE) { + throw new IllegalArgumentException + (theValue + " cannot be cast to int without changing its value."); + } + if(theValue!=null) { + setValue((int)theValue.longValue()); + } + } - /** - * @param original The exact representation of the number on the wire - */ - public void setOriginal(String original) { - this.original = original; - } - @Override - public IntegerType copy() { - IntegerType dst = new IntegerType(); - dst.value = value; - dst.original = original; - return dst; + protected Integer parse(String theValue) { + try { + return Integer.parseInt(theValue); + } catch (NumberFormatException e) { + throw new IllegalArgumentException(e); + } } - + @Override - protected Type typedCopy() { - return copy(); + protected String encode(Integer theValue) { + return Integer.toString(theValue); } - public String getStringValue() { - return java.lang.Integer.toString(value); - } - - @Override - public String asStringValue() { - return original != null ? original : java.lang.Integer.toString(value); - } - public boolean isEmpty() { - return super.isEmpty() && value == null; + @Override + public IntegerType copy() { + return new IntegerType(getValue()); } - public boolean hasValue() { - return value != null; - } - } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/List_.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/List_.java index 1865b6f0b69..d4c4745006e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/List_.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/List_.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="List_", profile="http://hl7.org/fhir/Profile/List_") public class List_ extends DomainResource { - public enum ListMode { + public enum ListMode implements FhirEnum { /** * This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes. */ @@ -62,7 +62,10 @@ public class List_ extends DomainResource { * added to help the parsers */ NULL; - public static ListMode fromCode(String codeString) throws Exception { + + public static final ListModeEnumFactory ENUM_FACTORY = new ListModeEnumFactory(); + + public static ListMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("working".equals(codeString)) @@ -71,8 +74,9 @@ public class List_ extends DomainResource { return SNAPSHOT; if ("changes".equals(codeString)) return CHANGES; - throw new Exception("Unknown ListMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case WORKING: return "working"; @@ -107,8 +111,8 @@ public class List_ extends DomainResource { } } - public static class ListModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ListModeEnumFactory implements EnumFactory { + public ListMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class List_ extends DomainResource { return ListMode.SNAPSHOT; if ("changes".equals(codeString)) return ListMode.CHANGES; - throw new Exception("Unknown ListMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ListMode code) throws IllegalArgumentException { if (code == ListMode.WORKING) return "working"; if (code == ListMode.SNAPSHOT) @@ -287,14 +291,14 @@ public class List_ extends DomainResource { /** * @return When this item was added to the list. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value When this item was added to the list. */ - public ListEntryComponent setDate(DateAndTime value) { + public ListEntryComponent setDate(Date value) { if (value == null) this.date = null; else { @@ -620,14 +624,14 @@ public class List_ extends DomainResource { /** * @return The date that the list was prepared. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date that the list was prepared. */ - public List_ setDate(DateAndTime value) { + public List_ setDate(Date value) { if (value == null) this.date = null; else { @@ -727,7 +731,7 @@ public class List_ extends DomainResource { */ public List_ setMode(ListMode value) { if (this.mode == null) - this.mode = new Enumeration(); + this.mode = new Enumeration(ListMode.ENUM_FACTORY); this.mode.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Location.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Location.java index f5ee5effb79..2aa7c29493d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Location.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Location.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -46,7 +46,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Location", profile="http://hl7.org/fhir/Profile/Location") public class Location extends DomainResource { - public enum LocationStatus { + public enum LocationStatus implements FhirEnum { /** * The location is operational. */ @@ -63,7 +63,10 @@ public class Location extends DomainResource { * added to help the parsers */ NULL; - public static LocationStatus fromCode(String codeString) throws Exception { + + public static final LocationStatusEnumFactory ENUM_FACTORY = new LocationStatusEnumFactory(); + + public static LocationStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("active".equals(codeString)) @@ -72,8 +75,9 @@ public class Location extends DomainResource { return SUSPENDED; if ("inactive".equals(codeString)) return INACTIVE; - throw new Exception("Unknown LocationStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ACTIVE: return "active"; @@ -108,8 +112,8 @@ public class Location extends DomainResource { } } - public static class LocationStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class LocationStatusEnumFactory implements EnumFactory { + public LocationStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -119,9 +123,9 @@ public class Location extends DomainResource { return LocationStatus.SUSPENDED; if ("inactive".equals(codeString)) return LocationStatus.INACTIVE; - throw new Exception("Unknown LocationStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(LocationStatus code) throws IllegalArgumentException { if (code == LocationStatus.ACTIVE) return "active"; if (code == LocationStatus.SUSPENDED) @@ -132,7 +136,7 @@ public class Location extends DomainResource { } } - public enum LocationMode { + public enum LocationMode implements FhirEnum { /** * The Location resource represents a specific instance of a Location. */ @@ -145,15 +149,19 @@ public class Location extends DomainResource { * added to help the parsers */ NULL; - public static LocationMode fromCode(String codeString) throws Exception { + + public static final LocationModeEnumFactory ENUM_FACTORY = new LocationModeEnumFactory(); + + public static LocationMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("instance".equals(codeString)) return INSTANCE; if ("kind".equals(codeString)) return KIND; - throw new Exception("Unknown LocationMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case INSTANCE: return "instance"; @@ -184,8 +192,8 @@ public class Location extends DomainResource { } } - public static class LocationModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class LocationModeEnumFactory implements EnumFactory { + public LocationMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -193,9 +201,9 @@ public class Location extends DomainResource { return LocationMode.INSTANCE; if ("kind".equals(codeString)) return LocationMode.KIND; - throw new Exception("Unknown LocationMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(LocationMode code) throws IllegalArgumentException { if (code == LocationMode.INSTANCE) return "instance"; if (code == LocationMode.KIND) @@ -842,7 +850,7 @@ public class Location extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(LocationStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -935,7 +943,7 @@ public class Location extends DomainResource { this.mode = null; else { if (this.mode == null) - this.mode = new Enumeration(); + this.mode = new Enumeration(LocationMode.ENUM_FACTORY); this.mode.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Media.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Media.java index 55fd7a725d5..69a7edaf8da 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Media.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Media.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Media", profile="http://hl7.org/fhir/Profile/Media") public class Media extends DomainResource { - public enum MediaType { + public enum MediaType implements FhirEnum { /** * The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents. */ @@ -62,7 +62,10 @@ public class Media extends DomainResource { * added to help the parsers */ NULL; - public static MediaType fromCode(String codeString) throws Exception { + + public static final MediaTypeEnumFactory ENUM_FACTORY = new MediaTypeEnumFactory(); + + public static MediaType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("photo".equals(codeString)) @@ -71,8 +74,9 @@ public class Media extends DomainResource { return VIDEO; if ("audio".equals(codeString)) return AUDIO; - throw new Exception("Unknown MediaType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MediaType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PHOTO: return "photo"; @@ -107,8 +111,8 @@ public class Media extends DomainResource { } } - public static class MediaTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class MediaTypeEnumFactory implements EnumFactory { + public MediaType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class Media extends DomainResource { return MediaType.VIDEO; if ("audio".equals(codeString)) return MediaType.AUDIO; - throw new Exception("Unknown MediaType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MediaType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(MediaType code) throws IllegalArgumentException { if (code == MediaType.PHOTO) return "photo"; if (code == MediaType.VIDEO) @@ -284,7 +288,7 @@ public class Media extends DomainResource { */ public Media setType(MediaType value) { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(MediaType.ENUM_FACTORY); this.type.setValue(value); return this; } @@ -374,14 +378,14 @@ public class Media extends DomainResource { /** * @return The date/time when the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the start of the recording. */ - public DateAndTime getCreated() { + public Date getCreated() { return this.created == null ? null : this.created.getValue(); } /** * @param value The date/time when the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the start of the recording. */ - public Media setCreated(DateAndTime value) { + public Media setCreated(Date value) { if (value == null) this.created = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Medication.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Medication.java index 4e4a2d6f037..708f822539d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Medication.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Medication.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Medication", profile="http://hl7.org/fhir/Profile/Medication") public class Medication extends DomainResource { - public enum MedicationKind { + public enum MedicationKind implements FhirEnum { /** * The medication is a product. */ @@ -58,15 +58,19 @@ public class Medication extends DomainResource { * added to help the parsers */ NULL; - public static MedicationKind fromCode(String codeString) throws Exception { + + public static final MedicationKindEnumFactory ENUM_FACTORY = new MedicationKindEnumFactory(); + + public static MedicationKind fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("product".equals(codeString)) return PRODUCT; if ("package".equals(codeString)) return PACKAGE; - throw new Exception("Unknown MedicationKind code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PRODUCT: return "product"; @@ -97,8 +101,8 @@ public class Medication extends DomainResource { } } - public static class MedicationKindEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class MedicationKindEnumFactory implements EnumFactory { + public MedicationKind fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -106,9 +110,9 @@ public class Medication extends DomainResource { return MedicationKind.PRODUCT; if ("package".equals(codeString)) return MedicationKind.PACKAGE; - throw new Exception("Unknown MedicationKind code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MedicationKind code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(MedicationKind code) throws IllegalArgumentException { if (code == MedicationKind.PRODUCT) return "product"; if (code == MedicationKind.PACKAGE) @@ -825,7 +829,7 @@ public class Medication extends DomainResource { this.kind = null; else { if (this.kind == null) - this.kind = new Enumeration(); + this.kind = new Enumeration(MedicationKind.ENUM_FACTORY); this.kind.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java index 50009ac491e..04597f0ddb0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationAdministration.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -47,7 +47,7 @@ Related resources tie this event to the authorizing prescription, and the specif @ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/Profile/MedicationAdministration") public class MedicationAdministration extends DomainResource { - public enum MedicationAdminStatus { + public enum MedicationAdminStatus implements FhirEnum { /** * The administration has started but has not yet completed. */ @@ -72,7 +72,10 @@ public class MedicationAdministration extends DomainResource { * added to help the parsers */ NULL; - public static MedicationAdminStatus fromCode(String codeString) throws Exception { + + public static final MedicationAdminStatusEnumFactory ENUM_FACTORY = new MedicationAdminStatusEnumFactory(); + + public static MedicationAdminStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("in progress".equals(codeString)) @@ -85,8 +88,9 @@ public class MedicationAdministration extends DomainResource { return ENTEREDINERROR; if ("stopped".equals(codeString)) return STOPPED; - throw new Exception("Unknown MedicationAdminStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case INPROGRESS: return "in progress"; @@ -129,8 +133,8 @@ public class MedicationAdministration extends DomainResource { } } - public static class MedicationAdminStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class MedicationAdminStatusEnumFactory implements EnumFactory { + public MedicationAdminStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -144,9 +148,9 @@ public class MedicationAdministration extends DomainResource { return MedicationAdminStatus.ENTEREDINERROR; if ("stopped".equals(codeString)) return MedicationAdminStatus.STOPPED; - throw new Exception("Unknown MedicationAdminStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MedicationAdminStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(MedicationAdminStatus code) throws IllegalArgumentException { if (code == MedicationAdminStatus.INPROGRESS) return "in progress"; if (code == MedicationAdminStatus.ONHOLD) @@ -683,7 +687,7 @@ Terminologies used often pre-coordinate this term with the route and or form of */ public MedicationAdministration setStatus(MedicationAdminStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(MedicationAdminStatus.ENUM_FACTORY); this.status.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java index fa666d55fcd..9b8df605b87 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationDispense.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/Profile/MedicationDispense") public class MedicationDispense extends DomainResource { - public enum MedicationDispenseStatus { + public enum MedicationDispenseStatus implements FhirEnum { /** * The dispense has started but has not yet completed. */ @@ -70,7 +70,10 @@ public class MedicationDispense extends DomainResource { * added to help the parsers */ NULL; - public static MedicationDispenseStatus fromCode(String codeString) throws Exception { + + public static final MedicationDispenseStatusEnumFactory ENUM_FACTORY = new MedicationDispenseStatusEnumFactory(); + + public static MedicationDispenseStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("in progress".equals(codeString)) @@ -83,8 +86,9 @@ public class MedicationDispense extends DomainResource { return ENTEREDINERROR; if ("stopped".equals(codeString)) return STOPPED; - throw new Exception("Unknown MedicationDispenseStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case INPROGRESS: return "in progress"; @@ -127,8 +131,8 @@ public class MedicationDispense extends DomainResource { } } - public static class MedicationDispenseStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class MedicationDispenseStatusEnumFactory implements EnumFactory { + public MedicationDispenseStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -142,9 +146,9 @@ public class MedicationDispense extends DomainResource { return MedicationDispenseStatus.ENTEREDINERROR; if ("stopped".equals(codeString)) return MedicationDispenseStatus.STOPPED; - throw new Exception("Unknown MedicationDispenseStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(MedicationDispenseStatus code) throws IllegalArgumentException { if (code == MedicationDispenseStatus.INPROGRESS) return "in progress"; if (code == MedicationDispenseStatus.ONHOLD) @@ -319,7 +323,7 @@ public class MedicationDispense extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(MedicationDispenseStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -448,14 +452,14 @@ public class MedicationDispense extends DomainResource { /** * @return The time when the dispensed product was packaged and reviewed. */ - public DateAndTime getWhenPrepared() { + public Date getWhenPrepared() { return this.whenPrepared == null ? null : this.whenPrepared.getValue(); } /** * @param value The time when the dispensed product was packaged and reviewed. */ - public MedicationDispenseDispenseComponent setWhenPrepared(DateAndTime value) { + public MedicationDispenseDispenseComponent setWhenPrepared(Date value) { if (value == null) this.whenPrepared = null; else { @@ -497,14 +501,14 @@ public class MedicationDispense extends DomainResource { /** * @return The time the dispensed product was provided to the patient or their representative. */ - public DateAndTime getWhenHandedOver() { + public Date getWhenHandedOver() { return this.whenHandedOver == null ? null : this.whenHandedOver.getValue(); } /** * @param value The time the dispensed product was provided to the patient or their representative. */ - public MedicationDispenseDispenseComponent setWhenHandedOver(DateAndTime value) { + public MedicationDispenseDispenseComponent setWhenHandedOver(Date value) { if (value == null) this.whenHandedOver = null; else { @@ -1354,7 +1358,7 @@ Terminologies used often pre-coordinate this term with the route and or form of this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(MedicationDispenseStatus.ENUM_FACTORY); this.status.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java index 2395e622f38..fe829d61fd5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationPrescription.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="MedicationPrescription", profile="http://hl7.org/fhir/Profile/MedicationPrescription") public class MedicationPrescription extends DomainResource { - public enum MedicationPrescriptionStatus { + public enum MedicationPrescriptionStatus implements FhirEnum { /** * The prescription is 'actionable', but not all actions that are implied by it have occurred yet. */ @@ -74,7 +74,10 @@ public class MedicationPrescription extends DomainResource { * added to help the parsers */ NULL; - public static MedicationPrescriptionStatus fromCode(String codeString) throws Exception { + + public static final MedicationPrescriptionStatusEnumFactory ENUM_FACTORY = new MedicationPrescriptionStatusEnumFactory(); + + public static MedicationPrescriptionStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("active".equals(codeString)) @@ -89,8 +92,9 @@ public class MedicationPrescription extends DomainResource { return STOPPED; if ("superceded".equals(codeString)) return SUPERCEDED; - throw new Exception("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ACTIVE: return "active"; @@ -137,8 +141,8 @@ public class MedicationPrescription extends DomainResource { } } - public static class MedicationPrescriptionStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class MedicationPrescriptionStatusEnumFactory implements EnumFactory { + public MedicationPrescriptionStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -154,9 +158,9 @@ public class MedicationPrescription extends DomainResource { return MedicationPrescriptionStatus.STOPPED; if ("superceded".equals(codeString)) return MedicationPrescriptionStatus.SUPERCEDED; - throw new Exception("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown MedicationPrescriptionStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(MedicationPrescriptionStatus code) throws IllegalArgumentException { if (code == MedicationPrescriptionStatus.ACTIVE) return "active"; if (code == MedicationPrescriptionStatus.ONHOLD) @@ -1112,14 +1116,14 @@ In some situations, this attribute may be used instead of quantity to identify t /** * @return The date (and perhaps time) when the prescription was written. */ - public DateAndTime getDateWritten() { + public Date getDateWritten() { return this.dateWritten == null ? null : this.dateWritten.getValue(); } /** * @param value The date (and perhaps time) when the prescription was written. */ - public MedicationPrescription setDateWritten(DateAndTime value) { + public MedicationPrescription setDateWritten(Date value) { if (value == null) this.dateWritten = null; else { @@ -1173,7 +1177,7 @@ In some situations, this attribute may be used instead of quantity to identify t this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(MedicationPrescriptionStatus.ENUM_FACTORY); this.status.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java index 98705615ecc..54482c569e8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MedicationStatement.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java index 1d8379f846c..3917d4204af 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/MessageHeader.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/Profile/MessageHeader") public class MessageHeader extends DomainResource { - public enum ResponseCode { + public enum ResponseCode implements FhirEnum { /** * The message was accepted and processed without error. */ @@ -62,7 +62,10 @@ public class MessageHeader extends DomainResource { * added to help the parsers */ NULL; - public static ResponseCode fromCode(String codeString) throws Exception { + + public static final ResponseCodeEnumFactory ENUM_FACTORY = new ResponseCodeEnumFactory(); + + public static ResponseCode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("ok".equals(codeString)) @@ -71,8 +74,9 @@ public class MessageHeader extends DomainResource { return TRANSIENTERROR; if ("fatal-error".equals(codeString)) return FATALERROR; - throw new Exception("Unknown ResponseCode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case OK: return "ok"; @@ -107,8 +111,8 @@ public class MessageHeader extends DomainResource { } } - public static class ResponseCodeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ResponseCodeEnumFactory implements EnumFactory { + public ResponseCode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class MessageHeader extends DomainResource { return ResponseCode.TRANSIENTERROR; if ("fatal-error".equals(codeString)) return ResponseCode.FATALERROR; - throw new Exception("Unknown ResponseCode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResponseCode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ResponseCode code) throws IllegalArgumentException { if (code == ResponseCode.OK) return "ok"; if (code == ResponseCode.TRANSIENTERROR) @@ -256,7 +260,7 @@ public class MessageHeader extends DomainResource { */ public MessageHeaderResponseComponent setCode(ResponseCode value) { if (this.code == null) - this.code = new Enumeration(); + this.code = new Enumeration(ResponseCode.ENUM_FACTORY); this.code.setValue(value); return this; } @@ -1019,14 +1023,14 @@ public class MessageHeader extends DomainResource { /** * @return The time that the message was sent. */ - public DateAndTime getTimestamp() { + public Date getTimestamp() { return this.timestamp == null ? null : this.timestamp.getValue(); } /** * @param value The time that the message was sent. */ - public MessageHeader setTimestamp(DateAndTime value) { + public MessageHeader setTimestamp(Date value) { if (this.timestamp == null) this.timestamp = new InstantType(); this.timestamp.setValue(value); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Money.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Money.java index 8b0ccbbedfc..aa915e44b47 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Money.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Money.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import org.hl7.fhir.instance.model.annotations.DatatypeDef; /** diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java index 3db0b32344e..bd3e44450e9 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NamingSystem.java @@ -29,12 +29,13 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; import org.hl7.fhir.instance.model.annotations.Block; import org.hl7.fhir.instance.model.annotations.Child; import org.hl7.fhir.instance.model.annotations.Description; @@ -44,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="NamingSystem", profile="http://hl7.org/fhir/Profile/NamingSystem") public class NamingSystem extends DomainResource { - public enum NamingsystemType { + public enum NamingsystemType implements FhirEnum { /** * The namingsystem is used to define concepts and symbols to represent those concepts. E.g. UCUM, LOINC, NDC code, local lab codes, etc. */ @@ -61,7 +62,10 @@ public class NamingSystem extends DomainResource { * added to help the parsers */ NULL; - public static NamingsystemType fromCode(String codeString) throws Exception { + + public static final NamingsystemTypeEnumFactory ENUM_FACTORY = new NamingsystemTypeEnumFactory(); + + public static NamingsystemType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("codesystem".equals(codeString)) @@ -70,8 +74,9 @@ public class NamingSystem extends DomainResource { return IDENTIFIER; if ("root".equals(codeString)) return ROOT; - throw new Exception("Unknown NamingsystemType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case CODESYSTEM: return "codesystem"; @@ -106,8 +111,8 @@ public class NamingSystem extends DomainResource { } } - public static class NamingsystemTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class NamingsystemTypeEnumFactory implements EnumFactory { + public NamingsystemType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -117,9 +122,9 @@ public class NamingSystem extends DomainResource { return NamingsystemType.IDENTIFIER; if ("root".equals(codeString)) return NamingsystemType.ROOT; - throw new Exception("Unknown NamingsystemType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NamingsystemType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(NamingsystemType code) throws IllegalArgumentException { if (code == NamingsystemType.CODESYSTEM) return "codesystem"; if (code == NamingsystemType.IDENTIFIER) @@ -130,7 +135,7 @@ public class NamingSystem extends DomainResource { } } - public enum NamingsystemStatus { + public enum NamingsystemStatus implements FhirEnum { /** * System has been submitted but not yet approved. */ @@ -147,7 +152,10 @@ public class NamingSystem extends DomainResource { * added to help the parsers */ NULL; - public static NamingsystemStatus fromCode(String codeString) throws Exception { + + public static final NamingsystemStatusEnumFactory ENUM_FACTORY = new NamingsystemStatusEnumFactory(); + + public static NamingsystemStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("proposed".equals(codeString)) @@ -156,8 +164,9 @@ public class NamingSystem extends DomainResource { return ACTIVE; if ("retired".equals(codeString)) return RETIRED; - throw new Exception("Unknown NamingsystemStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NamingsystemStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PROPOSED: return "proposed"; @@ -192,8 +201,8 @@ public class NamingSystem extends DomainResource { } } - public static class NamingsystemStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class NamingsystemStatusEnumFactory implements EnumFactory { + public NamingsystemStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -203,9 +212,9 @@ public class NamingSystem extends DomainResource { return NamingsystemStatus.ACTIVE; if ("retired".equals(codeString)) return NamingsystemStatus.RETIRED; - throw new Exception("Unknown NamingsystemStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NamingsystemStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(NamingsystemStatus code) throws IllegalArgumentException { if (code == NamingsystemStatus.PROPOSED) return "proposed"; if (code == NamingsystemStatus.ACTIVE) @@ -216,7 +225,7 @@ public class NamingSystem extends DomainResource { } } - public enum NamingsystemIdentifierType { + public enum NamingsystemIdentifierType implements FhirEnum { /** * An ISO object identifier. E.g. 1.2.3.4.5. */ @@ -237,7 +246,10 @@ public class NamingSystem extends DomainResource { * added to help the parsers */ NULL; - public static NamingsystemIdentifierType fromCode(String codeString) throws Exception { + + public static final NamingsystemIdentifierTypeEnumFactory ENUM_FACTORY = new NamingsystemIdentifierTypeEnumFactory(); + + public static NamingsystemIdentifierType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("oid".equals(codeString)) @@ -248,8 +260,9 @@ public class NamingSystem extends DomainResource { return URI; if ("other".equals(codeString)) return OTHER; - throw new Exception("Unknown NamingsystemIdentifierType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case OID: return "oid"; @@ -288,8 +301,8 @@ public class NamingSystem extends DomainResource { } } - public static class NamingsystemIdentifierTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class NamingsystemIdentifierTypeEnumFactory implements EnumFactory { + public NamingsystemIdentifierType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -301,9 +314,9 @@ public class NamingSystem extends DomainResource { return NamingsystemIdentifierType.URI; if ("other".equals(codeString)) return NamingsystemIdentifierType.OTHER; - throw new Exception("Unknown NamingsystemIdentifierType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NamingsystemIdentifierType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(NamingsystemIdentifierType code) throws IllegalArgumentException { if (code == NamingsystemIdentifierType.OID) return "oid"; if (code == NamingsystemIdentifierType.UUID) @@ -398,7 +411,7 @@ public class NamingSystem extends DomainResource { */ public NamingSystemUniqueIdComponent setType(NamingsystemIdentifierType value) { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(NamingsystemIdentifierType.ENUM_FACTORY); this.type.setValue(value); return this; } @@ -782,7 +795,7 @@ public class NamingSystem extends DomainResource { */ public NamingSystem setType(NamingsystemType value) { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(NamingsystemType.ENUM_FACTORY); this.type.setValue(value); return this; } @@ -872,7 +885,7 @@ public class NamingSystem extends DomainResource { */ public NamingSystem setStatus(NamingsystemStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(NamingsystemStatus.ENUM_FACTORY); this.status.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Narrative.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Narrative.java index 5fa81a13fa2..e2b180b3b73 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Narrative.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Narrative.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; import org.hl7.fhir.utilities.xhtml.XhtmlNode; @@ -44,7 +44,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef; @DatatypeDef(name="Narrative") public class Narrative extends Element { - public enum NarrativeStatus { + public enum NarrativeStatus implements FhirEnum { /** * The contents of the narrative are entirely generated from the structured data in the resource. */ @@ -65,7 +65,10 @@ public class Narrative extends Element { * added to help the parsers */ NULL; - public static NarrativeStatus fromCode(String codeString) throws Exception { + + public static final NarrativeStatusEnumFactory ENUM_FACTORY = new NarrativeStatusEnumFactory(); + + public static NarrativeStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("generated".equals(codeString)) @@ -76,8 +79,9 @@ public class Narrative extends Element { return ADDITIONAL; if ("empty".equals(codeString)) return EMPTY; - throw new Exception("Unknown NarrativeStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case GENERATED: return "generated"; @@ -116,8 +120,8 @@ public class Narrative extends Element { } } - public static class NarrativeStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class NarrativeStatusEnumFactory implements EnumFactory { + public NarrativeStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -129,9 +133,9 @@ public class Narrative extends Element { return NarrativeStatus.ADDITIONAL; if ("empty".equals(codeString)) return NarrativeStatus.EMPTY; - throw new Exception("Unknown NarrativeStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(NarrativeStatus code) throws IllegalArgumentException { if (code == NarrativeStatus.GENERATED) return "generated"; if (code == NarrativeStatus.EXTENSIONS) @@ -210,7 +214,7 @@ public class Narrative extends Element { */ public Narrative setStatus(NarrativeStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(NarrativeStatus.ENUM_FACTORY); this.status.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java index 4ec8ddb5c48..2293edd323f 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/NutritionOrder.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="NutritionOrder", profile="http://hl7.org/fhir/Profile/NutritionOrder") public class NutritionOrder extends DomainResource { - public enum NutritionOrderStatus { + public enum NutritionOrderStatus implements FhirEnum { /** * TODO. */ @@ -70,7 +70,10 @@ public class NutritionOrder extends DomainResource { * added to help the parsers */ NULL; - public static NutritionOrderStatus fromCode(String codeString) throws Exception { + + public static final NutritionOrderStatusEnumFactory ENUM_FACTORY = new NutritionOrderStatusEnumFactory(); + + public static NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("requested".equals(codeString)) @@ -83,8 +86,9 @@ public class NutritionOrder extends DomainResource { return HELD; if ("cancelled".equals(codeString)) return CANCELLED; - throw new Exception("Unknown NutritionOrderStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUESTED: return "requested"; @@ -127,8 +131,8 @@ public class NutritionOrder extends DomainResource { } } - public static class NutritionOrderStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class NutritionOrderStatusEnumFactory implements EnumFactory { + public NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -142,9 +146,9 @@ public class NutritionOrder extends DomainResource { return NutritionOrderStatus.HELD; if ("cancelled".equals(codeString)) return NutritionOrderStatus.CANCELLED; - throw new Exception("Unknown NutritionOrderStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(NutritionOrderStatus code) throws IllegalArgumentException { if (code == NutritionOrderStatus.REQUESTED) return "requested"; if (code == NutritionOrderStatus.ACTIVE) @@ -392,11 +396,11 @@ public class NutritionOrder extends DomainResource { @Block() public static class NutritionOrderItemOralDietComponent extends BackboneElement { /** - * A set of one or more codes representing diets that describe what can be consumed orally (i.e., take via the mouth). + * Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth). */ - @Child(name="code", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="A set of one or more codes representing diets that describe what can be consumed orally (i.e., take via the mouth)", formalDefinition="A set of one or more codes representing diets that describe what can be consumed orally (i.e., take via the mouth)." ) - protected List code; + @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Type of oral diet or diet restrictions that describe what can be consumed orally", formalDefinition="Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth)." ) + protected List type; /** * Class that defines the details of any nutrient modifications required for the oral diet. @@ -420,45 +424,45 @@ public class NutritionOrder extends DomainResource { protected List fluidConsistencyType; /** - * A descriptive name of the required diets that describe what can be consumed orally (i.e., take via the mouth). + * Additional instructions or information pertaining to the oral diet. */ - @Child(name="description", type={StringType.class}, order=5, min=0, max=1) - @Description(shortDefinition="A descriptive name of the required diets that describe what can be consumed orally (i.e., take via the mouth)", formalDefinition="A descriptive name of the required diets that describe what can be consumed orally (i.e., take via the mouth)." ) - protected StringType description; + @Child(name="instruction", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Instructions or additional information about the oral diet", formalDefinition="Additional instructions or information pertaining to the oral diet." ) + protected StringType instruction; - private static final long serialVersionUID = 551143196L; + private static final long serialVersionUID = 1978112477L; public NutritionOrderItemOralDietComponent() { super(); } /** - * @return {@link #code} (A set of one or more codes representing diets that describe what can be consumed orally (i.e., take via the mouth).) + * @return {@link #type} (Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).) */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; + public List getType() { + if (this.type == null) + this.type = new ArrayList(); + return this.type; } - public boolean hasCode() { - if (this.code == null) + public boolean hasType() { + if (this.type == null) return false; - for (CodeableConcept item : this.code) + for (CodeableConcept item : this.type) if (!item.isEmpty()) return true; return false; } /** - * @return {@link #code} (A set of one or more codes representing diets that describe what can be consumed orally (i.e., take via the mouth).) + * @return {@link #type} (Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).) */ // syntactic sugar - public CodeableConcept addCode() { //3 + public CodeableConcept addType() { //3 CodeableConcept t = new CodeableConcept(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); + if (this.type == null) + this.type = new ArrayList(); + this.type.add(t); return t; } @@ -553,70 +557,70 @@ public class NutritionOrder extends DomainResource { } /** - * @return {@link #description} (A descriptive name of the required diets that describe what can be consumed orally (i.e., take via the mouth).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + * @return {@link #instruction} (Additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value */ - public StringType getDescriptionElement() { - if (this.description == null) + public StringType getInstructionElement() { + if (this.instruction == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderItemOralDietComponent.description"); + throw new Error("Attempt to auto-create NutritionOrderItemOralDietComponent.instruction"); else if (Configuration.doAutoCreate()) - this.description = new StringType(); - return this.description; + this.instruction = new StringType(); + return this.instruction; } - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); + public boolean hasInstructionElement() { + return this.instruction != null && !this.instruction.isEmpty(); } - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); + public boolean hasInstruction() { + return this.instruction != null && !this.instruction.isEmpty(); } /** - * @param value {@link #description} (A descriptive name of the required diets that describe what can be consumed orally (i.e., take via the mouth).). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value + * @param value {@link #instruction} (Additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value */ - public NutritionOrderItemOralDietComponent setDescriptionElement(StringType value) { - this.description = value; + public NutritionOrderItemOralDietComponent setInstructionElement(StringType value) { + this.instruction = value; return this; } /** - * @return A descriptive name of the required diets that describe what can be consumed orally (i.e., take via the mouth). + * @return Additional instructions or information pertaining to the oral diet. */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); + public String getInstruction() { + return this.instruction == null ? null : this.instruction.getValue(); } /** - * @param value A descriptive name of the required diets that describe what can be consumed orally (i.e., take via the mouth). + * @param value Additional instructions or information pertaining to the oral diet. */ - public NutritionOrderItemOralDietComponent setDescription(String value) { + public NutritionOrderItemOralDietComponent setInstruction(String value) { if (Utilities.noString(value)) - this.description = null; + this.instruction = null; else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); + if (this.instruction == null) + this.instruction = new StringType(); + this.instruction.setValue(value); } return this; } protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A set of one or more codes representing diets that describe what can be consumed orally (i.e., take via the mouth).", 0, java.lang.Integer.MAX_VALUE, code)); + childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth).", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("nutrients", "", "Class that defines the details of any nutrient modifications required for the oral diet.", 0, java.lang.Integer.MAX_VALUE, nutrients)); childrenList.add(new Property("texture", "", "Class that describes any texture modifications required for the patient to safely consume various types of solid foods.", 0, java.lang.Integer.MAX_VALUE, texture)); childrenList.add(new Property("fluidConsistencyType", "CodeableConcept", "Identifies the required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.", 0, java.lang.Integer.MAX_VALUE, fluidConsistencyType)); - childrenList.add(new Property("description", "string", "A descriptive name of the required diets that describe what can be consumed orally (i.e., take via the mouth).", 0, java.lang.Integer.MAX_VALUE, description)); + childrenList.add(new Property("instruction", "string", "Additional instructions or information pertaining to the oral diet.", 0, java.lang.Integer.MAX_VALUE, instruction)); } public NutritionOrderItemOralDietComponent copy() { NutritionOrderItemOralDietComponent dst = new NutritionOrderItemOralDietComponent(); copyValues(dst); - if (code != null) { - dst.code = new ArrayList(); - for (CodeableConcept i : code) - dst.code.add(i.copy()); + if (type != null) { + dst.type = new ArrayList(); + for (CodeableConcept i : type) + dst.type.add(i.copy()); }; if (nutrients != null) { dst.nutrients = new ArrayList(); @@ -633,14 +637,14 @@ public class NutritionOrder extends DomainResource { for (CodeableConcept i : fluidConsistencyType) dst.fluidConsistencyType.add(i.copy()); }; - dst.description = description == null ? null : description.copy(); + dst.instruction = instruction == null ? null : instruction.copy(); return dst; } public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (nutrients == null || nutrients.isEmpty()) + return super.isEmpty() && (type == null || type.isEmpty()) && (nutrients == null || nutrients.isEmpty()) && (texture == null || texture.isEmpty()) && (fluidConsistencyType == null || fluidConsistencyType.isEmpty()) - && (description == null || description.isEmpty()); + && (instruction == null || instruction.isEmpty()); } } @@ -845,25 +849,25 @@ public class NutritionOrder extends DomainResource { /** * Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement. */ - @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Child(name="type", type={CodeableConcept.class}, order=1, min=0, max=1) @Description(shortDefinition="Type of supplement product requested", formalDefinition="Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement." ) - protected List type; + protected CodeableConcept type; /** * The amount of the nutritional supplement product to provide to the patient. */ @Child(name="quantity", type={Quantity.class}, order=2, min=0, max=1) - @Description(shortDefinition="The amount of the nutritional supplement product to provide to the patient", formalDefinition="The amount of the nutritional supplement product to provide to the patient." ) + @Description(shortDefinition="Amount of the nutritional supplement", formalDefinition="The amount of the nutritional supplement product to provide to the patient." ) protected Quantity quantity; /** - * The name of the nutritional supplement product to be provided to the patient. + * The product or brand name of the nutritional supplement product to be provided to the patient. */ @Child(name="name", type={StringType.class}, order=3, min=0, max=1) - @Description(shortDefinition="The name of the nutritional supplement product to be provided to the patient", formalDefinition="The name of the nutritional supplement product to be provided to the patient." ) + @Description(shortDefinition="Product or brand name of the nutritional supplement", formalDefinition="The product or brand name of the nutritional supplement product to be provided to the patient." ) protected StringType name; - private static final long serialVersionUID = -890013157L; + private static final long serialVersionUID = 505308801L; public NutritionOrderItemSupplementComponent() { super(); @@ -872,31 +876,25 @@ public class NutritionOrder extends DomainResource { /** * @return {@link #type} (Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.) */ - public List getType() { + public CodeableConcept getType() { if (this.type == null) - this.type = new ArrayList(); + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemSupplementComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeableConcept(); return this.type; } public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; + return this.type != null && !this.type.isEmpty(); } /** - * @return {@link #type} (Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.) + * @param value {@link #type} (Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.) */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; + public NutritionOrderItemSupplementComponent setType(CodeableConcept value) { + this.type = value; + return this; } /** @@ -924,7 +922,7 @@ public class NutritionOrder extends DomainResource { } /** - * @return {@link #name} (The name of the nutritional supplement product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + * @return {@link #name} (The product or brand name of the nutritional supplement product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value */ public StringType getNameElement() { if (this.name == null) @@ -944,7 +942,7 @@ public class NutritionOrder extends DomainResource { } /** - * @param value {@link #name} (The name of the nutritional supplement product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + * @param value {@link #name} (The product or brand name of the nutritional supplement product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value */ public NutritionOrderItemSupplementComponent setNameElement(StringType value) { this.name = value; @@ -952,14 +950,14 @@ public class NutritionOrder extends DomainResource { } /** - * @return The name of the nutritional supplement product to be provided to the patient. + * @return The product or brand name of the nutritional supplement product to be provided to the patient. */ public String getName() { return this.name == null ? null : this.name.getValue(); } /** - * @param value The name of the nutritional supplement product to be provided to the patient. + * @param value The product or brand name of the nutritional supplement product to be provided to the patient. */ public NutritionOrderItemSupplementComponent setName(String value) { if (Utilities.noString(value)) @@ -976,17 +974,13 @@ public class NutritionOrder extends DomainResource { super.listChildren(childrenList); childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("quantity", "Quantity", "The amount of the nutritional supplement product to provide to the patient.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("name", "string", "The name of the nutritional supplement product to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("name", "string", "The product or brand name of the nutritional supplement product to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, name)); } public NutritionOrderItemSupplementComponent copy() { NutritionOrderItemSupplementComponent dst = new NutritionOrderItemSupplementComponent(); copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; + dst.type = type == null ? null : type.copy(); dst.quantity = quantity == null ? null : quantity.copy(); dst.name = name == null ? null : name.copy(); return dst; @@ -1002,55 +996,139 @@ public class NutritionOrder extends DomainResource { @Block() public static class NutritionOrderItemEnteralFormulaComponent extends BackboneElement { /** - * Indicates the type of enteral or infant formula requested such as pediatric elemental formula or. + * Free text formula administration or feeding instructions for cases where the instructions are too complex to code. */ - @Child(name="baseFormulaType", type={CodeableConcept.class}, order=1, min=0, max=1) - @Description(shortDefinition="Type of enteral or infant formula", formalDefinition="Indicates the type of enteral or infant formula requested such as pediatric elemental formula or." ) + @Child(name="administrationInstructions", type={StringType.class}, order=1, min=0, max=1) + @Description(shortDefinition="Formula feeding instructions expressed as text", formalDefinition="Free text formula administration or feeding instructions for cases where the instructions are too complex to code." ) + protected StringType administrationInstructions; + + /** + * Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula. + */ + @Child(name="baseFormulaType", type={CodeableConcept.class}, order=2, min=0, max=1) + @Description(shortDefinition="Type of enteral or infant formula", formalDefinition="Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula." ) protected CodeableConcept baseFormulaType; /** - * Indicates the type of modular component such as protein, carbohydrate or fiber to be provided in addition to or mixed with the base formula. + * The product or brand name of the enteral or infant formula product to be provided to the patient. */ - @Child(name="additiveType", type={CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Type of module component to add to the feeding", formalDefinition="Indicates the type of modular component such as protein, carbohydrate or fiber to be provided in addition to or mixed with the base formula." ) - protected List additiveType; - - /** - * TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***. - */ - @Child(name="caloricDensity", type={Quantity.class}, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="TODO", formalDefinition="TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***." ) - protected List caloricDensity; - - /** - * ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***administration details including rate (ml per hour), route of adminstration, total volume. - */ - @Child(name="routeofAdministration", type={CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="TODO", formalDefinition="***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***administration details including rate (ml per hour), route of adminstration, total volume." ) - protected List routeofAdministration; - - /** - * TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***. - */ - @Child(name="rate", type={Quantity.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="TODO", formalDefinition="TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***." ) - protected List rate; - - /** - * TODO. - */ - @Child(name="baseFormulaName", type={StringType.class}, order=6, min=0, max=1) - @Description(shortDefinition="TODO", formalDefinition="TODO." ) + @Child(name="baseFormulaName", type={StringType.class}, order=3, min=0, max=1) + @Description(shortDefinition="Product or brand name of the enteral or infant formula", formalDefinition="The product or brand name of the enteral or infant formula product to be provided to the patient." ) protected StringType baseFormulaName; - private static final long serialVersionUID = -101595704L; + /** + * Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula. + */ + @Child(name="additiveType", type={CodeableConcept.class}, order=4, min=0, max=1) + @Description(shortDefinition="Type of modular component to add to the feeding", formalDefinition="Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula." ) + protected CodeableConcept additiveType; + + /** + * The product or brand name of the type of modular component to be added to the formula. + */ + @Child(name="additiveName", type={StringType.class}, order=5, min=0, max=1) + @Description(shortDefinition="Product or brand name of the modular additive", formalDefinition="The product or brand name of the type of modular component to be added to the formula." ) + protected StringType additiveName; + + /** + * The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL. + */ + @Child(name="caloricDensity", type={Quantity.class}, order=6, min=0, max=1) + @Description(shortDefinition="Amount of energy per specified volume that is required", formalDefinition="The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL." ) + protected Quantity caloricDensity; + + /** + * A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube. + */ + @Child(name="routeofAdministration", type={CodeableConcept.class}, order=7, min=0, max=1) + @Description(shortDefinition="How the formula should enter the patient's gastrointestinal tract", formalDefinition="A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube." ) + protected CodeableConcept routeofAdministration; + + /** + * The volume of formula to provide to the patient per the specified administration schedule. + */ + @Child(name="quantity", type={Quantity.class}, order=8, min=0, max=1) + @Description(shortDefinition="The volume of formula to provide", formalDefinition="The volume of formula to provide to the patient per the specified administration schedule." ) + protected Quantity quantity; + + /** + * Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule. + */ + @Child(name="rate", type={Ratio.class}, order=9, min=0, max=1) + @Description(shortDefinition="Speed with which the formula is provided per period of time", formalDefinition="Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule." ) + protected Ratio rate; + + /** + * The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours. + */ + @Child(name="rateAdjustment", type={Quantity.class}, order=10, min=0, max=1) + @Description(shortDefinition="Change in the rate of administration over a given time", formalDefinition="The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours." ) + protected Quantity rateAdjustment; + + /** + * The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours. + */ + @Child(name="maxVolumeToDeliver", type={Quantity.class}, order=11, min=0, max=1) + @Description(shortDefinition="Upper limit on formula volume per unit of time", formalDefinition="The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours." ) + protected Quantity maxVolumeToDeliver; + + private static final long serialVersionUID = 1106347909L; public NutritionOrderItemEnteralFormulaComponent() { super(); } /** - * @return {@link #baseFormulaType} (Indicates the type of enteral or infant formula requested such as pediatric elemental formula or.) + * @return {@link #administrationInstructions} (Free text formula administration or feeding instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstructions" gives direct access to the value + */ + public StringType getAdministrationInstructionsElement() { + if (this.administrationInstructions == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.administrationInstructions"); + else if (Configuration.doAutoCreate()) + this.administrationInstructions = new StringType(); + return this.administrationInstructions; + } + + public boolean hasAdministrationInstructionsElement() { + return this.administrationInstructions != null && !this.administrationInstructions.isEmpty(); + } + + public boolean hasAdministrationInstructions() { + return this.administrationInstructions != null && !this.administrationInstructions.isEmpty(); + } + + /** + * @param value {@link #administrationInstructions} (Free text formula administration or feeding instructions for cases where the instructions are too complex to code.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstructions" gives direct access to the value + */ + public NutritionOrderItemEnteralFormulaComponent setAdministrationInstructionsElement(StringType value) { + this.administrationInstructions = value; + return this; + } + + /** + * @return Free text formula administration or feeding instructions for cases where the instructions are too complex to code. + */ + public String getAdministrationInstructions() { + return this.administrationInstructions == null ? null : this.administrationInstructions.getValue(); + } + + /** + * @param value Free text formula administration or feeding instructions for cases where the instructions are too complex to code. + */ + public NutritionOrderItemEnteralFormulaComponent setAdministrationInstructions(String value) { + if (Utilities.noString(value)) + this.administrationInstructions = null; + else { + if (this.administrationInstructions == null) + this.administrationInstructions = new StringType(); + this.administrationInstructions.setValue(value); + } + return this; + } + + /** + * @return {@link #baseFormulaType} (Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.) */ public CodeableConcept getBaseFormulaType() { if (this.baseFormulaType == null) @@ -1066,7 +1144,7 @@ public class NutritionOrder extends DomainResource { } /** - * @param value {@link #baseFormulaType} (Indicates the type of enteral or infant formula requested such as pediatric elemental formula or.) + * @param value {@link #baseFormulaType} (Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.) */ public NutritionOrderItemEnteralFormulaComponent setBaseFormulaType(CodeableConcept value) { this.baseFormulaType = value; @@ -1074,127 +1152,7 @@ public class NutritionOrder extends DomainResource { } /** - * @return {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate or fiber to be provided in addition to or mixed with the base formula.) - */ - public List getAdditiveType() { - if (this.additiveType == null) - this.additiveType = new ArrayList(); - return this.additiveType; - } - - public boolean hasAdditiveType() { - if (this.additiveType == null) - return false; - for (CodeableConcept item : this.additiveType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate or fiber to be provided in addition to or mixed with the base formula.) - */ - // syntactic sugar - public CodeableConcept addAdditiveType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.additiveType == null) - this.additiveType = new ArrayList(); - this.additiveType.add(t); - return t; - } - - /** - * @return {@link #caloricDensity} (TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***.) - */ - public List getCaloricDensity() { - if (this.caloricDensity == null) - this.caloricDensity = new ArrayList(); - return this.caloricDensity; - } - - public boolean hasCaloricDensity() { - if (this.caloricDensity == null) - return false; - for (Quantity item : this.caloricDensity) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #caloricDensity} (TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***.) - */ - // syntactic sugar - public Quantity addCaloricDensity() { //3 - Quantity t = new Quantity(); - if (this.caloricDensity == null) - this.caloricDensity = new ArrayList(); - this.caloricDensity.add(t); - return t; - } - - /** - * @return {@link #routeofAdministration} (***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***administration details including rate (ml per hour), route of adminstration, total volume.) - */ - public List getRouteofAdministration() { - if (this.routeofAdministration == null) - this.routeofAdministration = new ArrayList(); - return this.routeofAdministration; - } - - public boolean hasRouteofAdministration() { - if (this.routeofAdministration == null) - return false; - for (CodeableConcept item : this.routeofAdministration) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #routeofAdministration} (***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***administration details including rate (ml per hour), route of adminstration, total volume.) - */ - // syntactic sugar - public CodeableConcept addRouteofAdministration() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.routeofAdministration == null) - this.routeofAdministration = new ArrayList(); - this.routeofAdministration.add(t); - return t; - } - - /** - * @return {@link #rate} (TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***.) - */ - public List getRate() { - if (this.rate == null) - this.rate = new ArrayList(); - return this.rate; - } - - public boolean hasRate() { - if (this.rate == null) - return false; - for (Quantity item : this.rate) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rate} (TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***.) - */ - // syntactic sugar - public Quantity addRate() { //3 - Quantity t = new Quantity(); - if (this.rate == null) - this.rate = new ArrayList(); - this.rate.add(t); - return t; - } - - /** - * @return {@link #baseFormulaName} (TODO.). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaName" gives direct access to the value + * @return {@link #baseFormulaName} (The product or brand name of the enteral or infant formula product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaName" gives direct access to the value */ public StringType getBaseFormulaNameElement() { if (this.baseFormulaName == null) @@ -1214,7 +1172,7 @@ public class NutritionOrder extends DomainResource { } /** - * @param value {@link #baseFormulaName} (TODO.). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaName" gives direct access to the value + * @param value {@link #baseFormulaName} (The product or brand name of the enteral or infant formula product to be provided to the patient.). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaName" gives direct access to the value */ public NutritionOrderItemEnteralFormulaComponent setBaseFormulaNameElement(StringType value) { this.baseFormulaName = value; @@ -1222,14 +1180,14 @@ public class NutritionOrder extends DomainResource { } /** - * @return TODO. + * @return The product or brand name of the enteral or infant formula product to be provided to the patient. */ public String getBaseFormulaName() { return this.baseFormulaName == null ? null : this.baseFormulaName.getValue(); } /** - * @param value TODO. + * @param value The product or brand name of the enteral or infant formula product to be provided to the patient. */ public NutritionOrderItemEnteralFormulaComponent setBaseFormulaName(String value) { if (Utilities.noString(value)) @@ -1242,49 +1200,262 @@ public class NutritionOrder extends DomainResource { return this; } + /** + * @return {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) + */ + public CodeableConcept getAdditiveType() { + if (this.additiveType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.additiveType"); + else if (Configuration.doAutoCreate()) + this.additiveType = new CodeableConcept(); + return this.additiveType; + } + + public boolean hasAdditiveType() { + return this.additiveType != null && !this.additiveType.isEmpty(); + } + + /** + * @param value {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) + */ + public NutritionOrderItemEnteralFormulaComponent setAdditiveType(CodeableConcept value) { + this.additiveType = value; + return this; + } + + /** + * @return {@link #additiveName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveName" gives direct access to the value + */ + public StringType getAdditiveNameElement() { + if (this.additiveName == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.additiveName"); + else if (Configuration.doAutoCreate()) + this.additiveName = new StringType(); + return this.additiveName; + } + + public boolean hasAdditiveNameElement() { + return this.additiveName != null && !this.additiveName.isEmpty(); + } + + public boolean hasAdditiveName() { + return this.additiveName != null && !this.additiveName.isEmpty(); + } + + /** + * @param value {@link #additiveName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveName" gives direct access to the value + */ + public NutritionOrderItemEnteralFormulaComponent setAdditiveNameElement(StringType value) { + this.additiveName = value; + return this; + } + + /** + * @return The product or brand name of the type of modular component to be added to the formula. + */ + public String getAdditiveName() { + return this.additiveName == null ? null : this.additiveName.getValue(); + } + + /** + * @param value The product or brand name of the type of modular component to be added to the formula. + */ + public NutritionOrderItemEnteralFormulaComponent setAdditiveName(String value) { + if (Utilities.noString(value)) + this.additiveName = null; + else { + if (this.additiveName == null) + this.additiveName = new StringType(); + this.additiveName.setValue(value); + } + return this; + } + + /** + * @return {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) + */ + public Quantity getCaloricDensity() { + if (this.caloricDensity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.caloricDensity"); + else if (Configuration.doAutoCreate()) + this.caloricDensity = new Quantity(); + return this.caloricDensity; + } + + public boolean hasCaloricDensity() { + return this.caloricDensity != null && !this.caloricDensity.isEmpty(); + } + + /** + * @param value {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) + */ + public NutritionOrderItemEnteralFormulaComponent setCaloricDensity(Quantity value) { + this.caloricDensity = value; + return this; + } + + /** + * @return {@link #routeofAdministration} (A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) + */ + public CodeableConcept getRouteofAdministration() { + if (this.routeofAdministration == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.routeofAdministration"); + else if (Configuration.doAutoCreate()) + this.routeofAdministration = new CodeableConcept(); + return this.routeofAdministration; + } + + public boolean hasRouteofAdministration() { + return this.routeofAdministration != null && !this.routeofAdministration.isEmpty(); + } + + /** + * @param value {@link #routeofAdministration} (A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.) + */ + public NutritionOrderItemEnteralFormulaComponent setRouteofAdministration(CodeableConcept value) { + this.routeofAdministration = value; + return this; + } + + /** + * @return {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) + */ + public NutritionOrderItemEnteralFormulaComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #rate} (Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) + */ + public Ratio getRate() { + if (this.rate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.rate"); + else if (Configuration.doAutoCreate()) + this.rate = new Ratio(); + return this.rate; + } + + public boolean hasRate() { + return this.rate != null && !this.rate.isEmpty(); + } + + /** + * @param value {@link #rate} (Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.) + */ + public NutritionOrderItemEnteralFormulaComponent setRate(Ratio value) { + this.rate = value; + return this; + } + + /** + * @return {@link #rateAdjustment} (The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.) + */ + public Quantity getRateAdjustment() { + if (this.rateAdjustment == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.rateAdjustment"); + else if (Configuration.doAutoCreate()) + this.rateAdjustment = new Quantity(); + return this.rateAdjustment; + } + + public boolean hasRateAdjustment() { + return this.rateAdjustment != null && !this.rateAdjustment.isEmpty(); + } + + /** + * @param value {@link #rateAdjustment} (The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.) + */ + public NutritionOrderItemEnteralFormulaComponent setRateAdjustment(Quantity value) { + this.rateAdjustment = value; + return this; + } + + /** + * @return {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) + */ + public Quantity getMaxVolumeToDeliver() { + if (this.maxVolumeToDeliver == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create NutritionOrderItemEnteralFormulaComponent.maxVolumeToDeliver"); + else if (Configuration.doAutoCreate()) + this.maxVolumeToDeliver = new Quantity(); + return this.maxVolumeToDeliver; + } + + public boolean hasMaxVolumeToDeliver() { + return this.maxVolumeToDeliver != null && !this.maxVolumeToDeliver.isEmpty(); + } + + /** + * @param value {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.) + */ + public NutritionOrderItemEnteralFormulaComponent setMaxVolumeToDeliver(Quantity value) { + this.maxVolumeToDeliver = value; + return this; + } + protected void listChildren(List childrenList) { super.listChildren(childrenList); - childrenList.add(new Property("baseFormulaType", "CodeableConcept", "Indicates the type of enteral or infant formula requested such as pediatric elemental formula or.", 0, java.lang.Integer.MAX_VALUE, baseFormulaType)); - childrenList.add(new Property("additiveType", "CodeableConcept", "Indicates the type of modular component such as protein, carbohydrate or fiber to be provided in addition to or mixed with the base formula.", 0, java.lang.Integer.MAX_VALUE, additiveType)); - childrenList.add(new Property("caloricDensity", "Quantity", "TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***.", 0, java.lang.Integer.MAX_VALUE, caloricDensity)); - childrenList.add(new Property("routeofAdministration", "CodeableConcept", "***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***administration details including rate (ml per hour), route of adminstration, total volume.", 0, java.lang.Integer.MAX_VALUE, routeofAdministration)); - childrenList.add(new Property("rate", "Quantity", "TODO ***CARD AND TYPE ARE PLACEHOLDERS TO COMPLETE BUILD. Need to discuss***.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("baseFormulaName", "string", "TODO.", 0, java.lang.Integer.MAX_VALUE, baseFormulaName)); + childrenList.add(new Property("administrationInstructions", "string", "Free text formula administration or feeding instructions for cases where the instructions are too complex to code.", 0, java.lang.Integer.MAX_VALUE, administrationInstructions)); + childrenList.add(new Property("baseFormulaType", "CodeableConcept", "Indicates the type of enteral or infant formula requested such as an adult standard formula with fiber or a soy-based infant formula.", 0, java.lang.Integer.MAX_VALUE, baseFormulaType)); + childrenList.add(new Property("baseFormulaName", "string", "The product or brand name of the enteral or infant formula product to be provided to the patient.", 0, java.lang.Integer.MAX_VALUE, baseFormulaName)); + childrenList.add(new Property("additiveType", "CodeableConcept", "Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.", 0, java.lang.Integer.MAX_VALUE, additiveType)); + childrenList.add(new Property("additiveName", "string", "The product or brand name of the type of modular component to be added to the formula.", 0, java.lang.Integer.MAX_VALUE, additiveName)); + childrenList.add(new Property("caloricDensity", "Quantity", "The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.", 0, java.lang.Integer.MAX_VALUE, caloricDensity)); + childrenList.add(new Property("routeofAdministration", "CodeableConcept", "A coded concept specifying the route or physiological path of administration into the patient 's gastroestestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube.", 0, java.lang.Integer.MAX_VALUE, routeofAdministration)); + childrenList.add(new Property("quantity", "Quantity", "The volume of formula to provide to the patient per the specified administration schedule.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("rate", "Ratio", "Identifies the speed with which the formula is introduced into the subject via a feeding pump, e.g., 60 mL per hour, according to the specified schedule.", 0, java.lang.Integer.MAX_VALUE, rate)); + childrenList.add(new Property("rateAdjustment", "Quantity", "The change in the administration rate over a given time, e.g. increase by 10 mL/hour every 4 hours.", 0, java.lang.Integer.MAX_VALUE, rateAdjustment)); + childrenList.add(new Property("maxVolumeToDeliver", "Quantity", "The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxVolumeToDeliver)); } public NutritionOrderItemEnteralFormulaComponent copy() { NutritionOrderItemEnteralFormulaComponent dst = new NutritionOrderItemEnteralFormulaComponent(); copyValues(dst); + dst.administrationInstructions = administrationInstructions == null ? null : administrationInstructions.copy(); dst.baseFormulaType = baseFormulaType == null ? null : baseFormulaType.copy(); - if (additiveType != null) { - dst.additiveType = new ArrayList(); - for (CodeableConcept i : additiveType) - dst.additiveType.add(i.copy()); - }; - if (caloricDensity != null) { - dst.caloricDensity = new ArrayList(); - for (Quantity i : caloricDensity) - dst.caloricDensity.add(i.copy()); - }; - if (routeofAdministration != null) { - dst.routeofAdministration = new ArrayList(); - for (CodeableConcept i : routeofAdministration) - dst.routeofAdministration.add(i.copy()); - }; - if (rate != null) { - dst.rate = new ArrayList(); - for (Quantity i : rate) - dst.rate.add(i.copy()); - }; dst.baseFormulaName = baseFormulaName == null ? null : baseFormulaName.copy(); + dst.additiveType = additiveType == null ? null : additiveType.copy(); + dst.additiveName = additiveName == null ? null : additiveName.copy(); + dst.caloricDensity = caloricDensity == null ? null : caloricDensity.copy(); + dst.routeofAdministration = routeofAdministration == null ? null : routeofAdministration.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.rate = rate == null ? null : rate.copy(); + dst.rateAdjustment = rateAdjustment == null ? null : rateAdjustment.copy(); + dst.maxVolumeToDeliver = maxVolumeToDeliver == null ? null : maxVolumeToDeliver.copy(); return dst; } public boolean isEmpty() { - return super.isEmpty() && (baseFormulaType == null || baseFormulaType.isEmpty()) && (additiveType == null || additiveType.isEmpty()) + return super.isEmpty() && (administrationInstructions == null || administrationInstructions.isEmpty()) + && (baseFormulaType == null || baseFormulaType.isEmpty()) && (baseFormulaName == null || baseFormulaName.isEmpty()) + && (additiveType == null || additiveType.isEmpty()) && (additiveName == null || additiveName.isEmpty()) && (caloricDensity == null || caloricDensity.isEmpty()) && (routeofAdministration == null || routeofAdministration.isEmpty()) - && (rate == null || rate.isEmpty()) && (baseFormulaName == null || baseFormulaName.isEmpty()) - ; + && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) && (rateAdjustment == null || rateAdjustment.isEmpty()) + && (maxVolumeToDeliver == null || maxVolumeToDeliver.isEmpty()); } } @@ -1584,14 +1755,14 @@ public class NutritionOrder extends DomainResource { /** * @return The date and time that this nutrition order was requested. */ - public DateAndTime getDateTime() { + public Date getDateTime() { return this.dateTime == null ? null : this.dateTime.getValue(); } /** * @param value The date and time that this nutrition order was requested. */ - public NutritionOrder setDateTime(DateAndTime value) { + public NutritionOrder setDateTime(Date value) { if (this.dateTime == null) this.dateTime = new DateTimeType(); this.dateTime.setValue(value); @@ -1782,7 +1953,7 @@ public class NutritionOrder extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(NutritionOrderStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -1863,7 +2034,7 @@ public class NutritionOrder extends DomainResource { public static final String SP_SUBJECT = "subject"; @SearchParamDefinition(name="supplement", path="NutritionOrder.item.supplement.type", description="Type of supplement product requested", type="token" ) public static final String SP_SUPPLEMENT = "supplement"; - @SearchParamDefinition(name="oraldiet", path="NutritionOrder.item.oralDiet.code", description="Code for diet that can be consumed orally (i.e., take via the mouth).", type="token" ) + @SearchParamDefinition(name="oraldiet", path="NutritionOrder.item.oralDiet.type", description="Type of diet that can be consumed orally (i.e., take via the mouth).", type="token" ) public static final String SP_ORALDIET = "oraldiet"; @SearchParamDefinition(name="provider", path="NutritionOrder.orderer", description="The identify of the provider who placed the nutrition order", type="reference" ) public static final String SP_PROVIDER = "provider"; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Observation.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Observation.java index fbca8fa5384..691af27ec6b 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Observation.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Observation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Observation", profile="http://hl7.org/fhir/Profile/Observation") public class Observation extends DomainResource { - public enum DataAbsentReason { + public enum DataAbsentReason implements FhirEnum { /** * The value is not known */ @@ -82,7 +82,10 @@ public class Observation extends DomainResource { * added to help the parsers */ NULL; - public static DataAbsentReason fromCode(String codeString) throws Exception { + + public static final DataAbsentReasonEnumFactory ENUM_FACTORY = new DataAbsentReasonEnumFactory(); + + public static DataAbsentReason fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("unknown".equals(codeString)) @@ -101,8 +104,9 @@ public class Observation extends DomainResource { return ASTEXT; if ("error".equals(codeString)) return ERROR; - throw new Exception("Unknown DataAbsentReason code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case UNKNOWN: return "unknown"; @@ -157,8 +161,8 @@ public class Observation extends DomainResource { } } - public static class DataAbsentReasonEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class DataAbsentReasonEnumFactory implements EnumFactory { + public DataAbsentReason fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -178,9 +182,9 @@ public class Observation extends DomainResource { return DataAbsentReason.ASTEXT; if ("error".equals(codeString)) return DataAbsentReason.ERROR; - throw new Exception("Unknown DataAbsentReason code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(DataAbsentReason code) throws IllegalArgumentException { if (code == DataAbsentReason.UNKNOWN) return "unknown"; if (code == DataAbsentReason.ASKED) @@ -201,7 +205,7 @@ public class Observation extends DomainResource { } } - public enum ObservationStatus { + public enum ObservationStatus implements FhirEnum { /** * The existence of the observation is registered, but there is no result yet available. */ @@ -230,7 +234,10 @@ public class Observation extends DomainResource { * added to help the parsers */ NULL; - public static ObservationStatus fromCode(String codeString) throws Exception { + + public static final ObservationStatusEnumFactory ENUM_FACTORY = new ObservationStatusEnumFactory(); + + public static ObservationStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("registered".equals(codeString)) @@ -245,8 +252,9 @@ public class Observation extends DomainResource { return CANCELLED; if ("entered in error".equals(codeString)) return ENTEREDINERROR; - throw new Exception("Unknown ObservationStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REGISTERED: return "registered"; @@ -293,8 +301,8 @@ public class Observation extends DomainResource { } } - public static class ObservationStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ObservationStatusEnumFactory implements EnumFactory { + public ObservationStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -310,9 +318,9 @@ public class Observation extends DomainResource { return ObservationStatus.CANCELLED; if ("entered in error".equals(codeString)) return ObservationStatus.ENTEREDINERROR; - throw new Exception("Unknown ObservationStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ObservationStatus code) throws IllegalArgumentException { if (code == ObservationStatus.REGISTERED) return "registered"; if (code == ObservationStatus.PRELIMINARY) @@ -329,7 +337,7 @@ public class Observation extends DomainResource { } } - public enum ObservationReliability { + public enum ObservationReliability implements FhirEnum { /** * The result has no reliability concerns. */ @@ -362,7 +370,10 @@ public class Observation extends DomainResource { * added to help the parsers */ NULL; - public static ObservationReliability fromCode(String codeString) throws Exception { + + public static final ObservationReliabilityEnumFactory ENUM_FACTORY = new ObservationReliabilityEnumFactory(); + + public static ObservationReliability fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("ok".equals(codeString)) @@ -379,8 +390,9 @@ public class Observation extends DomainResource { return ERROR; if ("unknown".equals(codeString)) return UNKNOWN; - throw new Exception("Unknown ObservationReliability code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case OK: return "ok"; @@ -431,8 +443,8 @@ public class Observation extends DomainResource { } } - public static class ObservationReliabilityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ObservationReliabilityEnumFactory implements EnumFactory { + public ObservationReliability fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -450,9 +462,9 @@ public class Observation extends DomainResource { return ObservationReliability.ERROR; if ("unknown".equals(codeString)) return ObservationReliability.UNKNOWN; - throw new Exception("Unknown ObservationReliability code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObservationReliability code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ObservationReliability code) throws IllegalArgumentException { if (code == ObservationReliability.OK) return "ok"; if (code == ObservationReliability.ONGOING) @@ -471,7 +483,7 @@ public class Observation extends DomainResource { } } - public enum ObservationRelationshiptypes { + public enum ObservationRelationshiptypes implements FhirEnum { /** * The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure). */ @@ -504,7 +516,10 @@ public class Observation extends DomainResource { * added to help the parsers */ NULL; - public static ObservationRelationshiptypes fromCode(String codeString) throws Exception { + + public static final ObservationRelationshiptypesEnumFactory ENUM_FACTORY = new ObservationRelationshiptypesEnumFactory(); + + public static ObservationRelationshiptypes fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("has-component".equals(codeString)) @@ -521,8 +536,9 @@ public class Observation extends DomainResource { return QUALIFIEDBY; if ("interfered-by".equals(codeString)) return INTERFEREDBY; - throw new Exception("Unknown ObservationRelationshiptypes code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case HASCOMPONENT: return "has-component"; @@ -573,8 +589,8 @@ public class Observation extends DomainResource { } } - public static class ObservationRelationshiptypesEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ObservationRelationshiptypesEnumFactory implements EnumFactory { + public ObservationRelationshiptypes fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -592,9 +608,9 @@ public class Observation extends DomainResource { return ObservationRelationshiptypes.QUALIFIEDBY; if ("interfered-by".equals(codeString)) return ObservationRelationshiptypes.INTERFEREDBY; - throw new Exception("Unknown ObservationRelationshiptypes code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObservationRelationshiptypes code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ObservationRelationshiptypes code) throws IllegalArgumentException { if (code == ObservationRelationshiptypes.HASCOMPONENT) return "has-component"; if (code == ObservationRelationshiptypes.HASMEMBER) @@ -904,7 +920,7 @@ public class Observation extends DomainResource { this.type = null; else { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(ObservationRelationshiptypes.ENUM_FACTORY); this.type.setValue(value); } return this; @@ -1300,7 +1316,7 @@ public class Observation extends DomainResource { this.dataAbsentReason = null; else { if (this.dataAbsentReason == null) - this.dataAbsentReason = new Enumeration(); + this.dataAbsentReason = new Enumeration(DataAbsentReason.ENUM_FACTORY); this.dataAbsentReason.setValue(value); } return this; @@ -1447,14 +1463,14 @@ public class Observation extends DomainResource { /** * @return The date and time this observation was made available. */ - public DateAndTime getIssued() { + public Date getIssued() { return this.issued == null ? null : this.issued.getValue(); } /** * @param value The date and time this observation was made available. */ - public Observation setIssued(DateAndTime value) { + public Observation setIssued(Date value) { if (value == null) this.issued = null; else { @@ -1505,7 +1521,7 @@ public class Observation extends DomainResource { */ public Observation setStatus(ObservationStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ObservationStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1553,7 +1569,7 @@ public class Observation extends DomainResource { this.reliability = null; else { if (this.reliability == null) - this.reliability = new Enumeration(); + this.reliability = new Enumeration(ObservationReliability.ENUM_FACTORY); this.reliability.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OidType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OidType.java index bc8a0046cc2..123ace2146d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OidType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OidType.java @@ -25,38 +25,45 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + */ package org.hl7.fhir.instance.model; +import java.net.URI; + /** * Primitive type "oid" in FHIR: an OID represented as urn:oid:0.1.2.3.4... */ public class OidType extends UriType { - private static final long serialVersionUID = -6684415951360862202L; + private static final long serialVersionUID = 2L; - public OidType(String value) { - this.value = value; - } - - public OidType() { - } - - @Override - protected Type typedCopy() { - return copy(); + /** + * Constructor + */ + public OidType() { + super(); } - + + /** + * Constructor + */ + public OidType(String theValue) { + super(theValue); + } + + /** + * Constructor + */ + public OidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ @Override - public OidType copy() { - OidType dst = new OidType(); - dst.value = value; - return dst; + public OidType copy() { + return new OidType(getValue()); } - - - public boolean hasValue() { - return value != null; - } - + } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java index 49d198883a8..24e0d072931 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationDefinition.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="OperationDefinition", profile="http://hl7.org/fhir/Profile/OperationDefinition") public class OperationDefinition extends DomainResource { - public enum ResourceProfileStatus { + public enum ResourceProfileStatus implements FhirEnum { /** * This profile is still under development. */ @@ -62,7 +62,10 @@ public class OperationDefinition extends DomainResource { * added to help the parsers */ NULL; - public static ResourceProfileStatus fromCode(String codeString) throws Exception { + + public static final ResourceProfileStatusEnumFactory ENUM_FACTORY = new ResourceProfileStatusEnumFactory(); + + public static ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("draft".equals(codeString)) @@ -71,8 +74,9 @@ public class OperationDefinition extends DomainResource { return ACTIVE; if ("retired".equals(codeString)) return RETIRED; - throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DRAFT: return "draft"; @@ -107,8 +111,8 @@ public class OperationDefinition extends DomainResource { } } - public static class ResourceProfileStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ResourceProfileStatusEnumFactory implements EnumFactory { + public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class OperationDefinition extends DomainResource { return ResourceProfileStatus.ACTIVE; if ("retired".equals(codeString)) return ResourceProfileStatus.RETIRED; - throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ResourceProfileStatus code) throws IllegalArgumentException { if (code == ResourceProfileStatus.DRAFT) return "draft"; if (code == ResourceProfileStatus.ACTIVE) @@ -131,7 +135,7 @@ public class OperationDefinition extends DomainResource { } } - public enum OperationKind { + public enum OperationKind implements FhirEnum { /** * This operation is invoked as an operation. */ @@ -144,15 +148,19 @@ public class OperationDefinition extends DomainResource { * added to help the parsers */ NULL; - public static OperationKind fromCode(String codeString) throws Exception { + + public static final OperationKindEnumFactory ENUM_FACTORY = new OperationKindEnumFactory(); + + public static OperationKind fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("operation".equals(codeString)) return OPERATION; if ("query".equals(codeString)) return QUERY; - throw new Exception("Unknown OperationKind code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case OPERATION: return "operation"; @@ -183,8 +191,8 @@ public class OperationDefinition extends DomainResource { } } - public static class OperationKindEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class OperationKindEnumFactory implements EnumFactory { + public OperationKind fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -192,9 +200,9 @@ public class OperationDefinition extends DomainResource { return OperationKind.OPERATION; if ("query".equals(codeString)) return OperationKind.QUERY; - throw new Exception("Unknown OperationKind code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(OperationKind code) throws IllegalArgumentException { if (code == OperationKind.OPERATION) return "operation"; if (code == OperationKind.QUERY) @@ -203,7 +211,7 @@ public class OperationDefinition extends DomainResource { } } - public enum OperationParameterUse { + public enum OperationParameterUse implements FhirEnum { /** * This is an input parameter. */ @@ -216,15 +224,19 @@ public class OperationDefinition extends DomainResource { * added to help the parsers */ NULL; - public static OperationParameterUse fromCode(String codeString) throws Exception { + + public static final OperationParameterUseEnumFactory ENUM_FACTORY = new OperationParameterUseEnumFactory(); + + public static OperationParameterUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("in".equals(codeString)) return IN; if ("out".equals(codeString)) return OUT; - throw new Exception("Unknown OperationParameterUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case IN: return "in"; @@ -255,8 +267,8 @@ public class OperationDefinition extends DomainResource { } } - public static class OperationParameterUseEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class OperationParameterUseEnumFactory implements EnumFactory { + public OperationParameterUse fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -264,9 +276,9 @@ public class OperationDefinition extends DomainResource { return OperationParameterUse.IN; if ("out".equals(codeString)) return OperationParameterUse.OUT; - throw new Exception("Unknown OperationParameterUse code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(OperationParameterUse code) throws IllegalArgumentException { if (code == OperationParameterUse.IN) return "in"; if (code == OperationParameterUse.OUT) @@ -315,9 +327,9 @@ public class OperationDefinition extends DomainResource { /** * The type for this parameter. */ - @Child(name="type", type={Coding.class}, order=6, min=1, max=1) + @Child(name="type", type={CodeType.class}, order=6, min=0, max=1) @Description(shortDefinition="What type this parameter hs", formalDefinition="The type for this parameter." ) - protected Coding type; + protected CodeType type; /** * A profile the specifies the rules that this parameter must conform to. @@ -331,19 +343,25 @@ public class OperationDefinition extends DomainResource { */ protected Profile profileTarget; - private static final long serialVersionUID = 55565452L; + /** + * The parts of a Tuple Parameter. + */ + @Child(name="part", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Parts of a Tuple Parameter", formalDefinition="The parts of a Tuple Parameter." ) + protected List part; + + private static final long serialVersionUID = 176609099L; public OperationDefinitionParameterComponent() { super(); } - public OperationDefinitionParameterComponent(CodeType name, Enumeration use, IntegerType min, StringType max, Coding type) { + public OperationDefinitionParameterComponent(CodeType name, Enumeration use, IntegerType min, StringType max) { super(); this.name = name; this.use = use; this.min = min; this.max = max; - this.type = type; } /** @@ -431,7 +449,7 @@ public class OperationDefinition extends DomainResource { */ public OperationDefinitionParameterComponent setUse(OperationParameterUse value) { if (this.use == null) - this.use = new Enumeration(); + this.use = new Enumeration(OperationParameterUse.ENUM_FACTORY); this.use.setValue(value); return this; } @@ -576,29 +594,54 @@ public class OperationDefinition extends DomainResource { } /** - * @return {@link #type} (The type for this parameter.) + * @return {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value */ - public Coding getType() { + public CodeType getTypeElement() { if (this.type == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.type"); else if (Configuration.doAutoCreate()) - this.type = new Coding(); + this.type = new CodeType(); return this.type; } + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + public boolean hasType() { return this.type != null && !this.type.isEmpty(); } /** - * @param value {@link #type} (The type for this parameter.) + * @param value {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value */ - public OperationDefinitionParameterComponent setType(Coding value) { + public OperationDefinitionParameterComponent setTypeElement(CodeType value) { this.type = value; return this; } + /** + * @return The type for this parameter. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type for this parameter. + */ + public OperationDefinitionParameterComponent setType(String value) { + if (Utilities.noString(value)) + this.type = null; + else { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + } + return this; + } + /** * @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.) */ @@ -643,6 +686,36 @@ public class OperationDefinition extends DomainResource { return this; } + /** + * @return {@link #part} (The parts of a Tuple Parameter.) + */ + public List getPart() { + if (this.part == null) + this.part = new ArrayList(); + return this.part; + } + + public boolean hasPart() { + if (this.part == null) + return false; + for (OperationDefinitionParameterPartComponent item : this.part) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #part} (The parts of a Tuple Parameter.) + */ + // syntactic sugar + public OperationDefinitionParameterPartComponent addPart() { //3 + OperationDefinitionParameterPartComponent t = new OperationDefinitionParameterPartComponent(); + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + return t; + } + protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); @@ -650,8 +723,9 @@ public class OperationDefinition extends DomainResource { childrenList.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min)); childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max)); childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("type", "Coding", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("profile", "Reference(Profile)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); + childrenList.add(new Property("part", "", "The parts of a Tuple Parameter.", 0, java.lang.Integer.MAX_VALUE, part)); } public OperationDefinitionParameterComponent copy() { @@ -664,13 +738,385 @@ public class OperationDefinition extends DomainResource { dst.documentation = documentation == null ? null : documentation.copy(); dst.type = type == null ? null : type.copy(); dst.profile = profile == null ? null : profile.copy(); + if (part != null) { + dst.part = new ArrayList(); + for (OperationDefinitionParameterPartComponent i : part) + dst.part.add(i.copy()); + }; return dst; } public boolean isEmpty() { return super.isEmpty() && (name == null || name.isEmpty()) && (use == null || use.isEmpty()) && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()); + && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) && (part == null || part.isEmpty()) + ; + } + + } + + @Block() + public static class OperationDefinitionParameterPartComponent extends BackboneElement { + /** + * The name of used to identify the parameter. + */ + @Child(name="name", type={CodeType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name of the parameter", formalDefinition="The name of used to identify the parameter." ) + protected CodeType name; + + /** + * The minimum number of times this parameter SHALL appear in the request or response. + */ + @Child(name="min", type={IntegerType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." ) + protected IntegerType min; + + /** + * The maximum number of times this element is permitted to appear in the request or response. + */ + @Child(name="max", type={StringType.class}, order=3, min=1, max=1) + @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." ) + protected StringType max; + + /** + * Describes the meaning or use of this parameter. + */ + @Child(name="documentation", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Description of meaning/use", formalDefinition="Describes the meaning or use of this parameter." ) + protected StringType documentation; + + /** + * The type for this parameter. + */ + @Child(name="type", type={CodeType.class}, order=5, min=1, max=1) + @Description(shortDefinition="What type this parameter hs", formalDefinition="The type for this parameter." ) + protected CodeType type; + + /** + * A profile the specifies the rules that this parameter must conform to. + */ + @Child(name="profile", type={Profile.class}, order=6, min=0, max=1) + @Description(shortDefinition="Profile on the type", formalDefinition="A profile the specifies the rules that this parameter must conform to." ) + protected Reference profile; + + /** + * The actual object that is the target of the reference (A profile the specifies the rules that this parameter must conform to.) + */ + protected Profile profileTarget; + + private static final long serialVersionUID = -2143629468L; + + public OperationDefinitionParameterPartComponent() { + super(); + } + + public OperationDefinitionParameterPartComponent(CodeType name, IntegerType min, StringType max, CodeType type) { + super(); + this.name = name; + this.min = min; + this.max = max; + this.type = type; + } + + /** + * @return {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public CodeType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new CodeType(); + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setNameElement(CodeType value) { + this.name = value; + return this; + } + + /** + * @return The name of used to identify the parameter. + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of used to identify the parameter. + */ + public OperationDefinitionParameterPartComponent setName(String value) { + if (this.name == null) + this.name = new CodeType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public IntegerType getMinElement() { + if (this.min == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.min"); + else if (Configuration.doAutoCreate()) + this.min = new IntegerType(); + return this.min; + } + + public boolean hasMinElement() { + return this.min != null && !this.min.isEmpty(); + } + + public boolean hasMin() { + return this.min != null && !this.min.isEmpty(); + } + + /** + * @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setMinElement(IntegerType value) { + this.min = value; + return this; + } + + /** + * @return The minimum number of times this parameter SHALL appear in the request or response. + */ + public int getMin() { + return this.min == null ? null : this.min.getValue(); + } + + /** + * @param value The minimum number of times this parameter SHALL appear in the request or response. + */ + public OperationDefinitionParameterPartComponent setMin(int value) { + if (this.min == null) + this.min = new IntegerType(); + this.min.setValue(value); + return this; + } + + /** + * @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public StringType getMaxElement() { + if (this.max == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.max"); + else if (Configuration.doAutoCreate()) + this.max = new StringType(); + return this.max; + } + + public boolean hasMaxElement() { + return this.max != null && !this.max.isEmpty(); + } + + public boolean hasMax() { + return this.max != null && !this.max.isEmpty(); + } + + /** + * @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setMaxElement(StringType value) { + this.max = value; + return this; + } + + /** + * @return The maximum number of times this element is permitted to appear in the request or response. + */ + public String getMax() { + return this.max == null ? null : this.max.getValue(); + } + + /** + * @param value The maximum number of times this element is permitted to appear in the request or response. + */ + public OperationDefinitionParameterPartComponent setMax(String value) { + if (this.max == null) + this.max = new StringType(); + this.max.setValue(value); + return this; + } + + /** + * @return {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public StringType getDocumentationElement() { + if (this.documentation == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.documentation"); + else if (Configuration.doAutoCreate()) + this.documentation = new StringType(); + return this.documentation; + } + + public boolean hasDocumentationElement() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + public boolean hasDocumentation() { + return this.documentation != null && !this.documentation.isEmpty(); + } + + /** + * @param value {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setDocumentationElement(StringType value) { + this.documentation = value; + return this; + } + + /** + * @return Describes the meaning or use of this parameter. + */ + public String getDocumentation() { + return this.documentation == null ? null : this.documentation.getValue(); + } + + /** + * @param value Describes the meaning or use of this parameter. + */ + public OperationDefinitionParameterPartComponent setDocumentation(String value) { + if (Utilities.noString(value)) + this.documentation = null; + else { + if (this.documentation == null) + this.documentation = new StringType(); + this.documentation.setValue(value); + } + return this; + } + + /** + * @return {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public CodeType getTypeElement() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new CodeType(); + return this.type; + } + + public boolean hasTypeElement() { + return this.type != null && !this.type.isEmpty(); + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value + */ + public OperationDefinitionParameterPartComponent setTypeElement(CodeType value) { + this.type = value; + return this; + } + + /** + * @return The type for this parameter. + */ + public String getType() { + return this.type == null ? null : this.type.getValue(); + } + + /** + * @param value The type for this parameter. + */ + public OperationDefinitionParameterPartComponent setType(String value) { + if (this.type == null) + this.type = new CodeType(); + this.type.setValue(value); + return this; + } + + /** + * @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.) + */ + public Reference getProfile() { + if (this.profile == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profile = new Reference(); + return this.profile; + } + + public boolean hasProfile() { + return this.profile != null && !this.profile.isEmpty(); + } + + /** + * @param value {@link #profile} (A profile the specifies the rules that this parameter must conform to.) + */ + public OperationDefinitionParameterPartComponent setProfile(Reference value) { + this.profile = value; + return this; + } + + /** + * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) + */ + public Profile getProfileTarget() { + if (this.profileTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create OperationDefinitionParameterPartComponent.profile"); + else if (Configuration.doAutoCreate()) + this.profileTarget = new Profile(); + return this.profileTarget; + } + + /** + * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) + */ + public OperationDefinitionParameterPartComponent setProfileTarget(Profile value) { + this.profileTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min)); + childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max)); + childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation)); + childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("profile", "Reference(Profile)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); + } + + public OperationDefinitionParameterPartComponent copy() { + OperationDefinitionParameterPartComponent dst = new OperationDefinitionParameterPartComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.min = min == null ? null : min.copy(); + dst.max = max == null ? null : max.copy(); + dst.documentation = documentation == null ? null : documentation.copy(); + dst.type = type == null ? null : type.copy(); + dst.profile = profile == null ? null : profile.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (min == null || min.isEmpty()) + && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty()) && (type == null || type.isEmpty()) + && (profile == null || profile.isEmpty()); } } @@ -800,10 +1246,10 @@ public class OperationDefinition extends DomainResource { protected BooleanType instance; /** - * Parameters for the operation/query. + * The parameters for the operation/query. */ @Child(name="parameter", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parameters for the operation/query", formalDefinition="Parameters for the operation/query." ) + @Description(shortDefinition="Parameters for the operation/query", formalDefinition="The parameters for the operation/query." ) protected List parameter; private static final long serialVersionUID = 300577956L; @@ -1163,7 +1609,7 @@ public class OperationDefinition extends DomainResource { */ public OperationDefinition setStatus(ResourceProfileStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ResourceProfileStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1248,14 +1694,14 @@ public class OperationDefinition extends DomainResource { /** * @return The date that this version of the profile was published. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date that this version of the profile was published. */ - public OperationDefinition setDate(DateAndTime value) { + public OperationDefinition setDate(Date value) { if (value == null) this.date = null; else { @@ -1306,7 +1752,7 @@ public class OperationDefinition extends DomainResource { */ public OperationDefinition setKind(OperationKind value) { if (this.kind == null) - this.kind = new Enumeration(); + this.kind = new Enumeration(OperationKind.ENUM_FACTORY); this.kind.setValue(value); return this; } @@ -1594,7 +2040,7 @@ public class OperationDefinition extends DomainResource { } /** - * @return {@link #parameter} (Parameters for the operation/query.) + * @return {@link #parameter} (The parameters for the operation/query.) */ public List getParameter() { if (this.parameter == null) @@ -1612,7 +2058,7 @@ public class OperationDefinition extends DomainResource { } /** - * @return {@link #parameter} (Parameters for the operation/query.) + * @return {@link #parameter} (The parameters for the operation/query.) */ // syntactic sugar public OperationDefinitionParameterComponent addParameter() { //3 @@ -1642,7 +2088,7 @@ public class OperationDefinition extends DomainResource { childrenList.add(new Property("system", "boolean", "Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, system)); childrenList.add(new Property("type", "code", "Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("instance", "boolean", "Indicates whether this operation can be invoked on a particular instance of one of the given types.", 0, java.lang.Integer.MAX_VALUE, instance)); - childrenList.add(new Property("parameter", "", "Parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter)); + childrenList.add(new Property("parameter", "", "The parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter)); } public OperationDefinition copy() { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java index 735290c9457..6d02a7e4b5c 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OperationOutcome.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/Profile/OperationOutcome") public class OperationOutcome extends DomainResource { - public enum IssueSeverity { + public enum IssueSeverity implements FhirEnum { /** * The issue caused the action to fail, and no further checking could be performed. */ @@ -66,7 +66,10 @@ public class OperationOutcome extends DomainResource { * added to help the parsers */ NULL; - public static IssueSeverity fromCode(String codeString) throws Exception { + + public static final IssueSeverityEnumFactory ENUM_FACTORY = new IssueSeverityEnumFactory(); + + public static IssueSeverity fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("fatal".equals(codeString)) @@ -77,8 +80,9 @@ public class OperationOutcome extends DomainResource { return WARNING; if ("information".equals(codeString)) return INFORMATION; - throw new Exception("Unknown IssueSeverity code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case FATAL: return "fatal"; @@ -117,8 +121,8 @@ public class OperationOutcome extends DomainResource { } } - public static class IssueSeverityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class IssueSeverityEnumFactory implements EnumFactory { + public IssueSeverity fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class OperationOutcome extends DomainResource { return IssueSeverity.WARNING; if ("information".equals(codeString)) return IssueSeverity.INFORMATION; - throw new Exception("Unknown IssueSeverity code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(IssueSeverity code) throws IllegalArgumentException { if (code == IssueSeverity.FATAL) return "fatal"; if (code == IssueSeverity.ERROR) @@ -226,7 +230,7 @@ public class OperationOutcome extends DomainResource { */ public OperationOutcomeIssueComponent setSeverity(IssueSeverity value) { if (this.severity == null) - this.severity = new Enumeration(); + this.severity = new Enumeration(IssueSeverity.ENUM_FACTORY); this.severity.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OralHealthClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OralHealthClaim.java index ac7251e6007..1ee23883149 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OralHealthClaim.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OralHealthClaim.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -46,7 +46,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="OralHealthClaim", profile="http://hl7.org/fhir/Profile/OralHealthClaim") public class OralHealthClaim extends DomainResource { - public enum UseLink { + public enum UseLink implements FhirEnum { /** * The treatment is complete and this represents a Claim for the services. */ @@ -67,7 +67,10 @@ public class OralHealthClaim extends DomainResource { * added to help the parsers */ NULL; - public static UseLink fromCode(String codeString) throws Exception { + + public static final UseLinkEnumFactory ENUM_FACTORY = new UseLinkEnumFactory(); + + public static UseLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("complete".equals(codeString)) @@ -78,8 +81,9 @@ public class OralHealthClaim extends DomainResource { return EXPLORATORY; if ("other".equals(codeString)) return OTHER; - throw new Exception("Unknown UseLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case COMPLETE: return "complete"; @@ -118,8 +122,8 @@ public class OralHealthClaim extends DomainResource { } } - public static class UseLinkEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -131,9 +135,9 @@ public class OralHealthClaim extends DomainResource { return UseLink.EXPLORATORY; if ("other".equals(codeString)) return UseLink.OTHER; - throw new Exception("Unknown UseLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(UseLink code) throws IllegalArgumentException { if (code == UseLink.COMPLETE) return "complete"; if (code == UseLink.PROPOSED) @@ -1061,14 +1065,14 @@ public class OralHealthClaim extends DomainResource { /** * @return The date of the extraction either known from records or patient reported estimate. */ - public DateAndTime getExtractiondate() { + public Date getExtractiondate() { return this.extractiondate == null ? null : this.extractiondate.getValue(); } /** * @param value The date of the extraction either known from records or patient reported estimate. */ - public MissingTeethComponent setExtractiondate(DateAndTime value) { + public MissingTeethComponent setExtractiondate(Date value) { if (value == null) this.extractiondate = null; else { @@ -1190,14 +1194,14 @@ public class OralHealthClaim extends DomainResource { /** * @return The intended start date for service. */ - public DateAndTime getStart() { + public Date getStart() { return this.start == null ? null : this.start.getValue(); } /** * @param value The intended start date for service. */ - public OrthodonticPlanComponent setStart(DateAndTime value) { + public OrthodonticPlanComponent setStart(Date value) { if (value == null) this.start = null; else { @@ -1463,98 +1467,105 @@ public class OralHealthClaim extends DomainResource { */ protected Practitioner providerTarget; + /** + * Diagnosis applicable for this service or product line. + */ + @Child(name="diagnosisLinkId", type={IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis Link", formalDefinition="Diagnosis applicable for this service or product line." ) + protected List diagnosisLinkId; + /** * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. */ - @Child(name="service", type={Coding.class}, order=4, min=1, max=1) + @Child(name="service", type={Coding.class}, order=5, min=1, max=1) @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) protected Coding service; /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name="serviceDate", type={DateType.class}, order=5, min=0, max=1) + @Child(name="serviceDate", type={DateType.class}, order=6, min=0, max=1) @Description(shortDefinition="Date of Service", formalDefinition="The date when the enclosed suite of services were performed or completed." ) protected DateType serviceDate; /** * The number of repetitions of a service or product. */ - @Child(name="quantity", type={Quantity.class}, order=6, min=0, max=1) + @Child(name="quantity", type={Quantity.class}, order=7, min=0, max=1) @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) protected Quantity quantity; /** * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. */ - @Child(name="unitPrice", type={Money.class}, order=7, min=0, max=1) + @Child(name="unitPrice", type={Money.class}, order=8, min=0, max=1) @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) protected Money unitPrice; /** * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. */ - @Child(name="factor", type={DecimalType.class}, order=8, min=0, max=1) + @Child(name="factor", type={DecimalType.class}, order=9, min=0, max=1) @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) protected DecimalType factor; /** * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. */ - @Child(name="points", type={DecimalType.class}, order=9, min=0, max=1) + @Child(name="points", type={DecimalType.class}, order=10, min=0, max=1) @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) protected DecimalType points; /** * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. */ - @Child(name="net", type={Money.class}, order=10, min=0, max=1) + @Child(name="net", type={Money.class}, order=11, min=0, max=1) @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) protected Money net; /** * List of Unique Device Identifiers associated with this line item. */ - @Child(name="udi", type={Coding.class}, order=11, min=0, max=1) + @Child(name="udi", type={Coding.class}, order=12, min=0, max=1) @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) protected Coding udi; /** * Physical service site on the patient (limb, tooth, etc). */ - @Child(name="bodySite", type={Coding.class}, order=12, min=0, max=1) + @Child(name="bodySite", type={Coding.class}, order=13, min=0, max=1) @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) protected Coding bodySite; /** * A region or surface of the site, eg. limb region or tooth surface(s). */ - @Child(name="subsite", type={Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Child(name="subsite", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) protected List subsite; /** * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. */ - @Child(name="modifier", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Child(name="modifier", type={Coding.class}, order=15, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." ) protected List modifier; /** * Second tier of goods and services. */ - @Child(name="detail", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Child(name="detail", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." ) protected List detail; /** * The materials and placement date of prior fixed prosthesis. */ - @Child(name="prosthesis", type={}, order=16, min=0, max=1) + @Child(name="prosthesis", type={}, order=17, min=0, max=1) @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." ) protected ProsthesisComponent prosthesis; - private static final long serialVersionUID = -1561435930L; + private static final long serialVersionUID = 1518140870L; public ItemsComponent() { super(); @@ -1680,6 +1691,60 @@ public class OralHealthClaim extends DomainResource { return this; } + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + return this.diagnosisLinkId; + } + + public boolean hasDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType item : this.diagnosisLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + // syntactic sugar + public IntegerType addDiagnosisLinkIdElement() {//2 + IntegerType t = new IntegerType(); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return t; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public ItemsComponent addDiagnosisLinkId(int value) { //1 + IntegerType t = new IntegerType(); + t.setValue(value); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return this; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public boolean hasDiagnosisLinkId(int value) { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType v : this.diagnosisLinkId) + if (v.equals(value)) // integer + return true; + return false; + } + /** * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) */ @@ -1735,14 +1800,14 @@ public class OralHealthClaim extends DomainResource { /** * @return The date when the enclosed suite of services were performed or completed. */ - public DateAndTime getServiceDate() { + public Date getServiceDate() { return this.serviceDate == null ? null : this.serviceDate.getValue(); } /** * @param value The date when the enclosed suite of services were performed or completed. */ - public ItemsComponent setServiceDate(DateAndTime value) { + public ItemsComponent setServiceDate(Date value) { if (value == null) this.serviceDate = null; else { @@ -2090,6 +2155,7 @@ public class OralHealthClaim extends DomainResource { childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("diagnosisLinkId", "integer", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); childrenList.add(new Property("serviceDate", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviceDate)); childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); @@ -2111,6 +2177,11 @@ public class OralHealthClaim extends DomainResource { dst.sequence = sequence == null ? null : sequence.copy(); dst.type = type == null ? null : type.copy(); dst.provider = provider == null ? null : provider.copy(); + if (diagnosisLinkId != null) { + dst.diagnosisLinkId = new ArrayList(); + for (IntegerType i : diagnosisLinkId) + dst.diagnosisLinkId.add(i.copy()); + }; dst.service = service == null ? null : service.copy(); dst.serviceDate = serviceDate == null ? null : serviceDate.copy(); dst.quantity = quantity == null ? null : quantity.copy(); @@ -2141,7 +2212,8 @@ public class OralHealthClaim extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (provider == null || provider.isEmpty()) && (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty()) + && (provider == null || provider.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) + && (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (subsite == null || subsite.isEmpty()) @@ -3107,14 +3179,14 @@ public class OralHealthClaim extends DomainResource { /** * @return Date of the initial placement. */ - public DateAndTime getPriorDate() { + public Date getPriorDate() { return this.priorDate == null ? null : this.priorDate.getValue(); } /** * @param value Date of the initial placement. */ - public ProsthesisComponent setPriorDate(DateAndTime value) { + public ProsthesisComponent setPriorDate(Date value) { if (value == null) this.priorDate = null; else { @@ -3196,9 +3268,9 @@ public class OralHealthClaim extends DomainResource { /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name="date", type={DateType.class}, order=2, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateType date; + protected DateTimeType created; /** * Insurer Identifier, typical BIN number (6 digit). @@ -3396,7 +3468,7 @@ public class OralHealthClaim extends DomainResource { @Description(shortDefinition="Additional materials, documents, etc.", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." ) protected List additionalMaterials; - private static final long serialVersionUID = 1132893716L; + private static final long serialVersionUID = -748490719L; public OralHealthClaim() { super(); @@ -3486,50 +3558,50 @@ public class OralHealthClaim extends DomainResource { } /** - * @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OralHealthClaim.date"); + throw new Error("Attempt to auto-create OralHealthClaim.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public OralHealthClaim setDateElement(DateType value) { - this.date = value; + public OralHealthClaim setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when the enclosed suite of services were performed or completed. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when the enclosed suite of services were performed or completed. */ - public OralHealthClaim setDate(DateAndTime value) { + public OralHealthClaim setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -3709,7 +3781,7 @@ public class OralHealthClaim extends DomainResource { this.use = null; else { if (this.use == null) - this.use = new Enumeration(); + this.use = new Enumeration(UseLink.ENUM_FACTORY); this.use.setValue(value); } return this; @@ -4163,14 +4235,14 @@ public class OralHealthClaim extends DomainResource { /** * @return Date of an accident which these services are addessing. */ - public DateAndTime getAccident() { + public Date getAccident() { return this.accident == null ? null : this.accident.getValue(); } /** * @param value Date of an accident which these services are addessing. */ - public OralHealthClaim setAccident(DateAndTime value) { + public OralHealthClaim setAccident(Date value) { if (value == null) this.accident = null; else { @@ -4354,7 +4426,7 @@ public class OralHealthClaim extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("target", "Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization)); @@ -4390,7 +4462,7 @@ public class OralHealthClaim extends DomainResource { }; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); @@ -4455,7 +4527,7 @@ public class OralHealthClaim extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) && (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) && (fundsReserve == null || fundsReserve.isEmpty()) && (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) && (payee == null || payee.isEmpty()) diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Order.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Order.java index 7434841d248..8c9bd304461 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Order.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Order.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -290,14 +290,14 @@ public class Order extends DomainResource { /** * @return When the order was made. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value When the order was made. */ - public Order setDate(DateAndTime value) { + public Order setDate(Date value) { if (value == null) this.date = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java index 585ee2a392f..4ee7eab6006 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/OrderResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="OrderResponse", profile="http://hl7.org/fhir/Profile/OrderResponse") public class OrderResponse extends DomainResource { - public enum OrderOutcomeCode { + public enum OrderOutcomeCode implements FhirEnum { /** * The order is known, but no processing has occurred at this time. */ @@ -86,7 +86,10 @@ public class OrderResponse extends DomainResource { * added to help the parsers */ NULL; - public static OrderOutcomeCode fromCode(String codeString) throws Exception { + + public static final OrderOutcomeCodeEnumFactory ENUM_FACTORY = new OrderOutcomeCodeEnumFactory(); + + public static OrderOutcomeCode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("pending".equals(codeString)) @@ -107,8 +110,9 @@ public class OrderResponse extends DomainResource { return ABORTED; if ("complete".equals(codeString)) return COMPLETE; - throw new Exception("Unknown OrderOutcomeCode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown OrderOutcomeCode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PENDING: return "pending"; @@ -167,8 +171,8 @@ public class OrderResponse extends DomainResource { } } - public static class OrderOutcomeCodeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class OrderOutcomeCodeEnumFactory implements EnumFactory { + public OrderOutcomeCode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -190,9 +194,9 @@ public class OrderResponse extends DomainResource { return OrderOutcomeCode.ABORTED; if ("complete".equals(codeString)) return OrderOutcomeCode.COMPLETE; - throw new Exception("Unknown OrderOutcomeCode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown OrderOutcomeCode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(OrderOutcomeCode code) throws IllegalArgumentException { if (code == OrderOutcomeCode.PENDING) return "pending"; if (code == OrderOutcomeCode.REVIEW) @@ -403,14 +407,14 @@ public class OrderResponse extends DomainResource { /** * @return The date and time at which this order response was made (created/posted). */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date and time at which this order response was made (created/posted). */ - public OrderResponse setDate(DateAndTime value) { + public OrderResponse setDate(Date value) { if (value == null) this.date = null; else { @@ -537,7 +541,7 @@ public class OrderResponse extends DomainResource { */ public OrderResponse setCode(OrderOutcomeCode value) { if (this.code == null) - this.code = new Enumeration(); + this.code = new Enumeration(OrderOutcomeCode.ENUM_FACTORY); this.code.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Organization.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Organization.java index 3aab3c384f0..114168d0b1b 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Organization.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Organization.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Organization", profile="http://hl7.org/fhir/Profile/Organization") public class Organization extends DomainResource { - public enum AdministrativeGender { + public enum AdministrativeGender implements FhirEnum { /** * Male */ @@ -66,7 +66,10 @@ public class Organization extends DomainResource { * added to help the parsers */ NULL; - public static AdministrativeGender fromCode(String codeString) throws Exception { + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("male".equals(codeString)) @@ -77,8 +80,9 @@ public class Organization extends DomainResource { return OTHER; if ("unknown".equals(codeString)) return UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case MALE: return "male"; @@ -117,8 +121,8 @@ public class Organization extends DomainResource { } } - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class Organization extends DomainResource { return AdministrativeGender.OTHER; if ("unknown".equals(codeString)) return AdministrativeGender.UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AdministrativeGender code) throws IllegalArgumentException { if (code == AdministrativeGender.MALE) return "male"; if (code == AdministrativeGender.FEMALE) @@ -333,7 +337,7 @@ public class Organization extends DomainResource { this.gender = null; else { if (this.gender == null) - this.gender = new Enumeration(); + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); this.gender.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Other.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Other.java index a60e756e0f1..12d2ae1e71a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Other.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Other.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -263,14 +263,14 @@ public class Other extends DomainResource { /** * @return Identifies when the resource was first created. */ - public DateAndTime getCreated() { + public Date getCreated() { return this.created == null ? null : this.created.getValue(); } /** * @param value Identifies when the resource was first created. */ - public Other setCreated(DateAndTime value) { + public Other setCreated(Date value) { if (value == null) this.created = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Parameters.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Parameters.java index de66d0b7f5e..f2b714c184b 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Parameters.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Parameters.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -68,7 +68,14 @@ public class Parameters extends Resource { @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." ) protected Resource resource; - private static final long serialVersionUID = 1120601371L; + /** + * A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple". + */ + @Child(name="part", type={}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Named part of a parameter (e.g. Tuple)", formalDefinition="A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'." ) + protected List part; + + private static final long serialVersionUID = 2101270343L; public ParametersParameterComponent() { super(); @@ -162,11 +169,42 @@ public class Parameters extends Resource { return this; } + /** + * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) + */ + public List getPart() { + if (this.part == null) + this.part = new ArrayList(); + return this.part; + } + + public boolean hasPart() { + if (this.part == null) + return false; + for (ParametersParameterPartComponent item : this.part) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) + */ + // syntactic sugar + public ParametersParameterPartComponent addPart() { //3 + ParametersParameterPartComponent t = new ParametersParameterPartComponent(); + if (this.part == null) + this.part = new ArrayList(); + this.part.add(t); + return t; + } + protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); childrenList.add(new Property("value[x]", "*", "If the parameter is a data type.", 0, java.lang.Integer.MAX_VALUE, value)); childrenList.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, java.lang.Integer.MAX_VALUE, resource)); + childrenList.add(new Property("part", "", "A named part of a parameter. In many implementation context, a set of named parts is known as a 'Tuple'.", 0, java.lang.Integer.MAX_VALUE, part)); } public ParametersParameterComponent copy() { @@ -175,12 +213,130 @@ public class Parameters extends Resource { dst.name = name == null ? null : name.copy(); dst.value = value == null ? null : value.copy(); dst.resource = resource == null ? null : resource.copy(); + if (part != null) { + dst.part = new ArrayList(); + for (ParametersParameterPartComponent i : part) + dst.part.add(i.copy()); + }; return dst; } public boolean isEmpty() { return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - && (resource == null || resource.isEmpty()); + && (resource == null || resource.isEmpty()) && (part == null || part.isEmpty()); + } + + } + + @Block() + public static class ParametersParameterPartComponent extends BackboneElement { + /** + * The name of the parameter (reference to the operation definition). + */ + @Child(name="name", type={StringType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) + protected StringType name; + + /** + * The value of the parameter. + */ + @Child(name="value", type={}, order=2, min=1, max=1) + @Description(shortDefinition="Value of the part", formalDefinition="The value of the parameter." ) + protected org.hl7.fhir.instance.model.Type value; + + private static final long serialVersionUID = 2130806097L; + + public ParametersParameterPartComponent() { + super(); + } + + public ParametersParameterPartComponent(StringType name, org.hl7.fhir.instance.model.Type value) { + super(); + this.name = name; + this.value = value; + } + + /** + * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public StringType getNameElement() { + if (this.name == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ParametersParameterPartComponent.name"); + else if (Configuration.doAutoCreate()) + this.name = new StringType(); + return this.name; + } + + public boolean hasNameElement() { + return this.name != null && !this.name.isEmpty(); + } + + public boolean hasName() { + return this.name != null && !this.name.isEmpty(); + } + + /** + * @param value {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value + */ + public ParametersParameterPartComponent setNameElement(StringType value) { + this.name = value; + return this; + } + + /** + * @return The name of the parameter (reference to the operation definition). + */ + public String getName() { + return this.name == null ? null : this.name.getValue(); + } + + /** + * @param value The name of the parameter (reference to the operation definition). + */ + public ParametersParameterPartComponent setName(String value) { + if (this.name == null) + this.name = new StringType(); + this.name.setValue(value); + return this; + } + + /** + * @return {@link #value} (The value of the parameter.) + */ + public org.hl7.fhir.instance.model.Type getValue() { + return this.value; + } + + public boolean hasValue() { + return this.value != null && !this.value.isEmpty(); + } + + /** + * @param value {@link #value} (The value of the parameter.) + */ + public ParametersParameterPartComponent setValue(org.hl7.fhir.instance.model.Type value) { + this.value = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("value[x]", "*", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value)); + } + + public ParametersParameterPartComponent copy() { + ParametersParameterPartComponent dst = new ParametersParameterPartComponent(); + copyValues(dst); + dst.name = name == null ? null : name.copy(); + dst.value = value == null ? null : value.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) + ; } } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Patient.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Patient.java index c22f06cf011..82285470c4f 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Patient.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Patient.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Patient", profile="http://hl7.org/fhir/Profile/Patient") public class Patient extends DomainResource { - public enum AdministrativeGender { + public enum AdministrativeGender implements FhirEnum { /** * Male */ @@ -66,7 +66,10 @@ public class Patient extends DomainResource { * added to help the parsers */ NULL; - public static AdministrativeGender fromCode(String codeString) throws Exception { + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("male".equals(codeString)) @@ -77,8 +80,9 @@ public class Patient extends DomainResource { return OTHER; if ("unknown".equals(codeString)) return UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case MALE: return "male"; @@ -117,8 +121,8 @@ public class Patient extends DomainResource { } } - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class Patient extends DomainResource { return AdministrativeGender.OTHER; if ("unknown".equals(codeString)) return AdministrativeGender.UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AdministrativeGender code) throws IllegalArgumentException { if (code == AdministrativeGender.MALE) return "male"; if (code == AdministrativeGender.FEMALE) @@ -145,7 +149,7 @@ public class Patient extends DomainResource { } } - public enum LinkType { + public enum LinkType implements FhirEnum { /** * The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link. */ @@ -162,7 +166,10 @@ public class Patient extends DomainResource { * added to help the parsers */ NULL; - public static LinkType fromCode(String codeString) throws Exception { + + public static final LinkTypeEnumFactory ENUM_FACTORY = new LinkTypeEnumFactory(); + + public static LinkType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("replace".equals(codeString)) @@ -171,8 +178,9 @@ public class Patient extends DomainResource { return REFER; if ("seealso".equals(codeString)) return SEEALSO; - throw new Exception("Unknown LinkType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REPLACE: return "replace"; @@ -207,8 +215,8 @@ public class Patient extends DomainResource { } } - public static class LinkTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class LinkTypeEnumFactory implements EnumFactory { + public LinkType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -218,9 +226,9 @@ public class Patient extends DomainResource { return LinkType.REFER; if ("seealso".equals(codeString)) return LinkType.SEEALSO; - throw new Exception("Unknown LinkType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(LinkType code) throws IllegalArgumentException { if (code == LinkType.REPLACE) return "replace"; if (code == LinkType.REFER) @@ -444,7 +452,7 @@ public class Patient extends DomainResource { this.gender = null; else { if (this.gender == null) - this.gender = new Enumeration(); + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); this.gender.setValue(value); } return this; @@ -805,7 +813,7 @@ public class Patient extends DomainResource { */ public PatientLinkComponent setType(LinkType value) { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(LinkType.ENUM_FACTORY); this.type.setValue(value); return this; } @@ -1099,7 +1107,7 @@ public class Patient extends DomainResource { this.gender = null; else { if (this.gender == null) - this.gender = new Enumeration(); + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); this.gender.setValue(value); } return this; @@ -1136,14 +1144,14 @@ public class Patient extends DomainResource { /** * @return The date and time of birth for the individual. */ - public DateAndTime getBirthDate() { + public Date getBirthDate() { return this.birthDate == null ? null : this.birthDate.getValue(); } /** * @param value The date and time of birth for the individual. */ - public Patient setBirthDate(DateAndTime value) { + public Patient setBirthDate(Date value) { if (value == null) this.birthDate = null; else { @@ -1681,10 +1689,10 @@ public class Patient extends DomainResource { public static final String SP_TELECOM = "telecom"; @SearchParamDefinition(name="birthdate", path="Patient.birthDate", description="The patient's date of birth", type="date" ) public static final String SP_BIRTHDATE = "birthdate"; - @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token" ) - public static final String SP_GENDER = "gender"; @SearchParamDefinition(name="active", path="Patient.active", description="Whether the patient record is active", type="token" ) public static final String SP_ACTIVE = "active"; + @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token" ) + public static final String SP_GENDER = "gender"; @SearchParamDefinition(name="language", path="Patient.communication", description="Language code (irrespective of use value)", type="token" ) public static final String SP_LANGUAGE = "language"; @SearchParamDefinition(name="identifier", path="Patient.identifier", description="A patient identifier", type="token" ) diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java index 8f774933765..6e28896ba26 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentNotice.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -68,15 +68,15 @@ public class PaymentNotice extends DomainResource { /** * The date when this resource was created. */ - @Child(name="date", type={DateType.class}, order=2, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who is target of the request. */ @Child(name="target", type={Organization.class}, order=3, min=0, max=1) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) + @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target of the request." ) protected Reference target; /** @@ -139,7 +139,7 @@ public class PaymentNotice extends DomainResource { @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." ) protected Coding paymentStatus; - private static final long serialVersionUID = -1361815149L; + private static final long serialVersionUID = -394826458L; public PaymentNotice() { super(); @@ -229,50 +229,50 @@ public class PaymentNotice extends DomainResource { } /** - * @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.date"); + throw new Error("Attempt to auto-create PaymentNotice.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public PaymentNotice setDateElement(DateType value) { - this.date = value; + public PaymentNotice setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when this resource was created. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when this resource was created. */ - public PaymentNotice setDate(DateAndTime value) { + public PaymentNotice setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -516,7 +516,7 @@ public class PaymentNotice extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); @@ -535,7 +535,7 @@ public class PaymentNotice extends DomainResource { }; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); @@ -551,7 +551,7 @@ public class PaymentNotice extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (paymentStatus == null || paymentStatus.isEmpty()) ; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java index 0ef394f2a3f..3c9f88b9bd6 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PaymentReconciliation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="PaymentReconciliation", profile="http://hl7.org/fhir/Profile/PaymentReconciliation") public class PaymentReconciliation extends DomainResource { - public enum RSLink { + public enum RSLink implements FhirEnum { /** * The processing completed without errors. */ @@ -58,15 +58,19 @@ public class PaymentReconciliation extends DomainResource { * added to help the parsers */ NULL; - public static RSLink fromCode(String codeString) throws Exception { + + public static final RSLinkEnumFactory ENUM_FACTORY = new RSLinkEnumFactory(); + + public static RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("complete".equals(codeString)) return COMPLETE; if ("error".equals(codeString)) return ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case COMPLETE: return "complete"; @@ -97,8 +101,8 @@ public class PaymentReconciliation extends DomainResource { } } - public static class RSLinkEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class RSLinkEnumFactory implements EnumFactory { + public RSLink fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -106,9 +110,9 @@ public class PaymentReconciliation extends DomainResource { return RSLink.COMPLETE; if ("error".equals(codeString)) return RSLink.ERROR; - throw new Exception("Unknown RSLink code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown RSLink code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(RSLink code) throws IllegalArgumentException { if (code == RSLink.COMPLETE) return "complete"; if (code == RSLink.ERROR) @@ -420,14 +424,14 @@ public class PaymentReconciliation extends DomainResource { /** * @return The date of the invoice or financial resource. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date of the invoice or financial resource. */ - public DetailsComponent setDate(DateAndTime value) { + public DetailsComponent setDate(Date value) { if (value == null) this.date = null; else { @@ -621,14 +625,14 @@ public class PaymentReconciliation extends DomainResource { /** * Original request resource referrence. */ - @Child(name="request", type={Enrollment.class}, order=0, min=0, max=1) + @Child(name="request", type={PendedRequest.class}, order=0, min=0, max=1) @Description(shortDefinition="Claim reference", formalDefinition="Original request resource referrence." ) protected Reference request; /** * The actual object that is the target of the reference (Original request resource referrence.) */ - protected Enrollment requestTarget; + protected PendedRequest requestTarget; /** * Transaction status: error, complete. @@ -661,14 +665,21 @@ public class PaymentReconciliation extends DomainResource { /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name="date", type={DateType.class}, order=5, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateType date; + protected DateTimeType created; + + /** + * The period of time for which payments have been gathered into this bulk payment for settlement. + */ + @Child(name="period", type={Period.class}, order=6, min=0, max=1) + @Description(shortDefinition="Period covered", formalDefinition="The period of time for which payments have been gathered into this bulk payment for settlement." ) + protected Period period; /** * The Insurer who produced this adjudicated response. */ - @Child(name="organization", type={Organization.class}, order=6, min=0, max=1) + @Child(name="organization", type={Organization.class}, order=7, min=0, max=1) @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) protected Reference organization; @@ -680,7 +691,7 @@ public class PaymentReconciliation extends DomainResource { /** * The practitioner who is responsible for the services rendered to the patient. */ - @Child(name="requestProvider", type={Practitioner.class}, order=7, min=0, max=1) + @Child(name="requestProvider", type={Practitioner.class}, order=8, min=0, max=1) @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) protected Reference requestProvider; @@ -692,7 +703,7 @@ public class PaymentReconciliation extends DomainResource { /** * The organization which is responsible for the services rendered to the patient. */ - @Child(name="requestOrganization", type={Organization.class}, order=8, min=0, max=1) + @Child(name="requestOrganization", type={Organization.class}, order=9, min=0, max=1) @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) protected Reference requestOrganization; @@ -704,39 +715,39 @@ public class PaymentReconciliation extends DomainResource { /** * List of individual settlement amounts and the corresponding transaction. */ - @Child(name="detail", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) + @Child(name="detail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Details", formalDefinition="List of individual settlement amounts and the corresponding transaction." ) protected List detail; /** * The form to be used for printing the content. */ - @Child(name="form", type={Coding.class}, order=10, min=0, max=1) + @Child(name="form", type={Coding.class}, order=11, min=0, max=1) @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) protected Coding form; /** * Total payment amount. */ - @Child(name="total", type={Money.class}, order=11, min=1, max=1) + @Child(name="total", type={Money.class}, order=12, min=1, max=1) @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount." ) protected Money total; /** * List of errors detected in the request. */ - @Child(name="error", type={Coding.class}, order=12, min=0, max=Child.MAX_UNLIMITED) + @Child(name="error", type={Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Error code", formalDefinition="List of errors detected in the request." ) protected List error; /** * Suite of notes. */ - @Child(name="note", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Child(name="note", type={}, order=14, min=0, max=Child.MAX_UNLIMITED) @Description(shortDefinition="Note text", formalDefinition="Suite of notes." ) protected List note; - private static final long serialVersionUID = -484463801L; + private static final long serialVersionUID = 1739436327L; public PaymentReconciliation() { super(); @@ -804,19 +815,19 @@ public class PaymentReconciliation extends DomainResource { /** * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) */ - public Enrollment getRequestTarget() { + public PendedRequest getRequestTarget() { if (this.requestTarget == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PaymentReconciliation.request"); else if (Configuration.doAutoCreate()) - this.requestTarget = new Enrollment(); + this.requestTarget = new PendedRequest(); return this.requestTarget; } /** * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource referrence.) */ - public PaymentReconciliation setRequestTarget(Enrollment value) { + public PaymentReconciliation setRequestTarget(PendedRequest value) { this.requestTarget = value; return this; } @@ -864,7 +875,7 @@ public class PaymentReconciliation extends DomainResource { this.outcome = null; else { if (this.outcome == null) - this.outcome = new Enumeration(); + this.outcome = new Enumeration(RSLink.ENUM_FACTORY); this.outcome.setValue(value); } return this; @@ -968,54 +979,78 @@ public class PaymentReconciliation extends DomainResource { } /** - * @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.date"); + throw new Error("Attempt to auto-create PaymentReconciliation.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public PaymentReconciliation setDateElement(DateType value) { - this.date = value; + public PaymentReconciliation setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when the enclosed suite of services were performed or completed. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when the enclosed suite of services were performed or completed. */ - public PaymentReconciliation setDate(DateAndTime value) { + public PaymentReconciliation setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } + /** + * @return {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PaymentReconciliation.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) + */ + public PaymentReconciliation setPeriod(Period value) { + this.period = value; + return this; + } + /** * @return {@link #organization} (The Insurer who produced this adjudicated response.) */ @@ -1289,12 +1324,13 @@ public class PaymentReconciliation extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(Enrollment)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); + childrenList.add(new Property("request", "Reference(PendedRequest)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("period", "Period", "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, java.lang.Integer.MAX_VALUE, period)); childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); @@ -1318,7 +1354,8 @@ public class PaymentReconciliation extends DomainResource { dst.disposition = disposition == null ? null : disposition.copy(); dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); + dst.period = period == null ? null : period.copy(); dst.organization = organization == null ? null : organization.copy(); dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); @@ -1350,10 +1387,10 @@ public class PaymentReconciliation extends DomainResource { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty()) - && (requestOrganization == null || requestOrganization.isEmpty()) && (detail == null || detail.isEmpty()) - && (form == null || form.isEmpty()) && (total == null || total.isEmpty()) && (error == null || error.isEmpty()) - && (note == null || note.isEmpty()); + && (created == null || created.isEmpty()) && (period == null || period.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + && (detail == null || detail.isEmpty()) && (form == null || form.isEmpty()) && (total == null || total.isEmpty()) + && (error == null || error.isEmpty()) && (note == null || note.isEmpty()); } @Override diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PendedRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PendedRequest.java index 792ca7d6133..e51919a68d9 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PendedRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PendedRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -69,9 +69,9 @@ public class PendedRequest extends DomainResource { /** * The date when this resource was created. */ - @Child(name="date", type={DateType.class}, order=2, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who is target of the request. @@ -125,17 +125,24 @@ public class PendedRequest extends DomainResource { * Names of resource types to include. */ @Child(name="include", type={StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Resource type to include", formalDefinition="Names of resource types to include." ) + @Description(shortDefinition="Resource type(s) to include", formalDefinition="Names of resource types to include." ) protected List include; /** * Names of resource types to exclude. */ @Child(name="exclude", type={StringType.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Resource type to exclude", formalDefinition="Names of resource types to exclude." ) + @Description(shortDefinition="Resource type(s) to exclude", formalDefinition="Names of resource types to exclude." ) protected List exclude; - private static final long serialVersionUID = 426386451L; + /** + * A period of time during which the fulfilling resources would have been created. + */ + @Child(name="period", type={Period.class}, order=9, min=0, max=1) + @Description(shortDefinition="Period", formalDefinition="A period of time during which the fulfilling resources would have been created." ) + protected Period period; + + private static final long serialVersionUID = 1211492560L; public PendedRequest() { super(); @@ -220,50 +227,50 @@ public class PendedRequest extends DomainResource { } /** - * @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PendedRequest.date"); + throw new Error("Attempt to auto-create PendedRequest.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public PendedRequest setDateElement(DateType value) { - this.date = value; + public PendedRequest setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when this resource was created. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when this resource was created. */ - public PendedRequest setDate(DateAndTime value) { + public PendedRequest setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -547,18 +554,43 @@ public class PendedRequest extends DomainResource { return false; } + /** + * @return {@link #period} (A period of time during which the fulfilling resources would have been created.) + */ + public Period getPeriod() { + if (this.period == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PendedRequest.period"); + else if (Configuration.doAutoCreate()) + this.period = new Period(); + return this.period; + } + + public boolean hasPeriod() { + return this.period != null && !this.period.isEmpty(); + } + + /** + * @param value {@link #period} (A period of time during which the fulfilling resources would have been created.) + */ + public PendedRequest setPeriod(Period value) { + this.period = value; + return this; + } + protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); childrenList.add(new Property("request", "Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); childrenList.add(new Property("include", "string", "Names of resource types to include.", 0, java.lang.Integer.MAX_VALUE, include)); childrenList.add(new Property("exclude", "string", "Names of resource types to exclude.", 0, java.lang.Integer.MAX_VALUE, exclude)); + childrenList.add(new Property("period", "Period", "A period of time during which the fulfilling resources would have been created.", 0, java.lang.Integer.MAX_VALUE, period)); } public PendedRequest copy() { @@ -571,7 +603,7 @@ public class PendedRequest extends DomainResource { }; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); @@ -586,6 +618,7 @@ public class PendedRequest extends DomainResource { for (StringType i : exclude) dst.exclude.add(i.copy()); }; + dst.period = period == null ? null : period.copy(); return dst; } @@ -595,10 +628,10 @@ public class PendedRequest extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) && (request == null || request.isEmpty()) && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) - ; + && (period == null || period.isEmpty()); } @Override diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Period.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Period.java index 1d62ea743dd..8666637195a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Period.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Period.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -93,14 +93,14 @@ public class Period extends Type { /** * @return The start of the period. The boundary is inclusive. */ - public DateAndTime getStart() { + public Date getStart() { return this.start == null ? null : this.start.getValue(); } /** * @param value The start of the period. The boundary is inclusive. */ - public Period setStart(DateAndTime value) { + public Period setStart(Date value) { if (value == null) this.start = null; else { @@ -142,14 +142,14 @@ public class Period extends Type { /** * @return The end of the period. If the end of the period is missing, it means that the period is ongoing. */ - public DateAndTime getEnd() { + public Date getEnd() { return this.end == null ? null : this.end.getValue(); } /** * @param value The end of the period. If the end of the period is missing, it means that the period is ongoing. */ - public Period setEnd(DateAndTime value) { + public Period setEnd(Date value) { if (value == null) this.end = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Person.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Person.java new file mode 100644 index 00000000000..cab47c7f2dc --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Person.java @@ -0,0 +1,927 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * Demographics and administrative information about a person independent of a specific health-related context. + */ +@ResourceDef(name="Person", profile="http://hl7.org/fhir/Profile/Person") +public class Person extends DomainResource { + + public enum AdministrativeGender implements FhirEnum { + /** + * Male + */ + MALE, + /** + * Female + */ + FEMALE, + /** + * Other + */ + OTHER, + /** + * Unknown + */ + UNKNOWN, + /** + * added to help the parsers + */ + NULL; + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return MALE; + if ("female".equals(codeString)) + return FEMALE; + if ("other".equals(codeString)) + return OTHER; + if ("unknown".equals(codeString)) + return UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case MALE: return ""; + case FEMALE: return ""; + case OTHER: return ""; + case UNKNOWN: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case MALE: return "Male"; + case FEMALE: return "Female"; + case OTHER: return "Other"; + case UNKNOWN: return "Unknown"; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case MALE: return "male"; + case FEMALE: return "female"; + case OTHER: return "other"; + case UNKNOWN: return "unknown"; + default: return "?"; + } + } + } + + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("male".equals(codeString)) + return AdministrativeGender.MALE; + if ("female".equals(codeString)) + return AdministrativeGender.FEMALE; + if ("other".equals(codeString)) + return AdministrativeGender.OTHER; + if ("unknown".equals(codeString)) + return AdministrativeGender.UNKNOWN; + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); + } + public String toCode(AdministrativeGender code) throws IllegalArgumentException { + if (code == AdministrativeGender.MALE) + return "male"; + if (code == AdministrativeGender.FEMALE) + return "female"; + if (code == AdministrativeGender.OTHER) + return "other"; + if (code == AdministrativeGender.UNKNOWN) + return "unknown"; + return "?"; + } + } + + public enum IdentityAssuranceLevel implements FhirEnum { + /** + * Little or no confidence in the asserted identity's accuracy. + */ + LEVEL1, + /** + * Some confidence in the asserted identity's accuracy. + */ + LEVEL2, + /** + * High confidence in the asserted identity's accuracy. + */ + LEVEL3, + /** + * Very high confidence in the asserted identity's accuracy. + */ + LEVEL4, + /** + * added to help the parsers + */ + NULL; + + public static final IdentityAssuranceLevelEnumFactory ENUM_FACTORY = new IdentityAssuranceLevelEnumFactory(); + + public static IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("level1".equals(codeString)) + return LEVEL1; + if ("level2".equals(codeString)) + return LEVEL2; + if ("level3".equals(codeString)) + return LEVEL3; + if ("level4".equals(codeString)) + return LEVEL4; + throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case LEVEL1: return "level1"; + case LEVEL2: return "level2"; + case LEVEL3: return "level3"; + case LEVEL4: return "level4"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case LEVEL1: return ""; + case LEVEL2: return ""; + case LEVEL3: return ""; + case LEVEL4: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case LEVEL1: return "Little or no confidence in the asserted identity's accuracy."; + case LEVEL2: return "Some confidence in the asserted identity's accuracy."; + case LEVEL3: return "High confidence in the asserted identity's accuracy."; + case LEVEL4: return "Very high confidence in the asserted identity's accuracy."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case LEVEL1: return "Level 1"; + case LEVEL2: return "Level 2"; + case LEVEL3: return "Level 3"; + case LEVEL4: return "Level 4"; + default: return "?"; + } + } + } + + public static class IdentityAssuranceLevelEnumFactory implements EnumFactory { + public IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("level1".equals(codeString)) + return IdentityAssuranceLevel.LEVEL1; + if ("level2".equals(codeString)) + return IdentityAssuranceLevel.LEVEL2; + if ("level3".equals(codeString)) + return IdentityAssuranceLevel.LEVEL3; + if ("level4".equals(codeString)) + return IdentityAssuranceLevel.LEVEL4; + throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); + } + public String toCode(IdentityAssuranceLevel code) throws IllegalArgumentException { + if (code == IdentityAssuranceLevel.LEVEL1) + return "level1"; + if (code == IdentityAssuranceLevel.LEVEL2) + return "level2"; + if (code == IdentityAssuranceLevel.LEVEL3) + return "level3"; + if (code == IdentityAssuranceLevel.LEVEL4) + return "level4"; + return "?"; + } + } + + @Block() + public static class PersonLinkComponent extends BackboneElement { + /** + * The resource to which this actual person is associated. + */ + @Child(name="other", type={Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1) + @Description(shortDefinition="The resource to which this actual person is associated", formalDefinition="The resource to which this actual person is associated." ) + protected Reference other; + + /** + * The actual object that is the target of the reference (The resource to which this actual person is associated.) + */ + protected Resource otherTarget; + + /** + * Level of assurance that this link is actually associated with the referenced record. + */ + @Child(name="assurance", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the referenced record." ) + protected Enumeration assurance; + + private static final long serialVersionUID = -1417349007L; + + public PersonLinkComponent() { + super(); + } + + public PersonLinkComponent(Reference other) { + super(); + this.other = other; + } + + /** + * @return {@link #other} (The resource to which this actual person is associated.) + */ + public Reference getOther() { + if (this.other == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PersonLinkComponent.other"); + else if (Configuration.doAutoCreate()) + this.other = new Reference(); + return this.other; + } + + public boolean hasOther() { + return this.other != null && !this.other.isEmpty(); + } + + /** + * @param value {@link #other} (The resource to which this actual person is associated.) + */ + public PersonLinkComponent setOther(Reference value) { + this.other = value; + return this; + } + + /** + * @return {@link #other} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.) + */ + public Resource getOtherTarget() { + return this.otherTarget; + } + + /** + * @param value {@link #other} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.) + */ + public PersonLinkComponent setOtherTarget(Resource value) { + this.otherTarget = value; + return this; + } + + /** + * @return {@link #assurance} (Level of assurance that this link is actually associated with the referenced record.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value + */ + public Enumeration getAssuranceElement() { + if (this.assurance == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PersonLinkComponent.assurance"); + else if (Configuration.doAutoCreate()) + this.assurance = new Enumeration(); + return this.assurance; + } + + public boolean hasAssuranceElement() { + return this.assurance != null && !this.assurance.isEmpty(); + } + + public boolean hasAssurance() { + return this.assurance != null && !this.assurance.isEmpty(); + } + + /** + * @param value {@link #assurance} (Level of assurance that this link is actually associated with the referenced record.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value + */ + public PersonLinkComponent setAssuranceElement(Enumeration value) { + this.assurance = value; + return this; + } + + /** + * @return Level of assurance that this link is actually associated with the referenced record. + */ + public IdentityAssuranceLevel getAssurance() { + return this.assurance == null ? null : this.assurance.getValue(); + } + + /** + * @param value Level of assurance that this link is actually associated with the referenced record. + */ + public PersonLinkComponent setAssurance(IdentityAssuranceLevel value) { + if (value == null) + this.assurance = null; + else { + if (this.assurance == null) + this.assurance = new Enumeration(IdentityAssuranceLevel.ENUM_FACTORY); + this.assurance.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("other", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, java.lang.Integer.MAX_VALUE, other)); + childrenList.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the referenced record.", 0, java.lang.Integer.MAX_VALUE, assurance)); + } + + public PersonLinkComponent copy() { + PersonLinkComponent dst = new PersonLinkComponent(); + copyValues(dst); + dst.other = other == null ? null : other.copy(); + dst.assurance = assurance == null ? null : assurance.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (other == null || other.isEmpty()) && (assurance == null || assurance.isEmpty()) + ; + } + + } + + /** + * Identifier for a person within a particular scope. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A Human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) + protected List identifier; + + /** + * A name associated with the person. + */ + @Child(name="name", type={HumanName.class}, order=0, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) + protected List name; + + /** + * A contact detail for the person, e.g. a telephone number or an email address. + */ + @Child(name="telecom", type={ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) + protected List telecom; + + /** + * Administrative Gender. + */ + @Child(name="gender", type={CodeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." ) + protected Enumeration gender; + + /** + * The birth date for the person. + */ + @Child(name="birthDate", type={DateTimeType.class}, order=3, min=0, max=1) + @Description(shortDefinition="The birth date for the person", formalDefinition="The birth date for the person." ) + protected DateTimeType birthDate; + + /** + * One or more addresses for the person. + */ + @Child(name="address", type={Address.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." ) + protected List
      address; + + /** + * An image that can be displayed as a thumbnail of the person to enhance the identification of the individual. + */ + @Child(name="photo", type={Attachment.class}, order=5, min=0, max=1) + @Description(shortDefinition="Image of the Person", formalDefinition="An image that can be displayed as a thumbnail of the person to enhance the identification of the individual." ) + protected Attachment photo; + + /** + * The Organization that is the custodian of the person record. + */ + @Child(name="managingOrganization", type={Organization.class}, order=6, min=0, max=1) + @Description(shortDefinition="The Organization that is the custodian of the person record", formalDefinition="The Organization that is the custodian of the person record." ) + protected Reference managingOrganization; + + /** + * The actual object that is the target of the reference (The Organization that is the custodian of the person record.) + */ + protected Organization managingOrganizationTarget; + + /** + * Whether this person's record is in active use. + */ + @Child(name="active", type={BooleanType.class}, order=7, min=0, max=1) + @Description(shortDefinition="This person's record is in active use", formalDefinition="Whether this person's record is in active use." ) + protected BooleanType active; + + /** + * Link to a resource that converns the same actual person. + */ + @Child(name="link", type={}, order=8, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Link to a resource that converns the same actual person", formalDefinition="Link to a resource that converns the same actual person." ) + protected List link; + + private static final long serialVersionUID = -2072707611L; + + public Person() { + super(); + } + + /** + * @return {@link #identifier} (Identifier for a person within a particular scope.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (Identifier for a person within a particular scope.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + public List getName() { + if (this.name == null) + this.name = new ArrayList(); + return this.name; + } + + public boolean hasName() { + if (this.name == null) + return false; + for (HumanName item : this.name) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #name} (A name associated with the person.) + */ + // syntactic sugar + public HumanName addName() { //3 + HumanName t = new HumanName(); + if (this.name == null) + this.name = new ArrayList(); + this.name.add(t); + return t; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + public List getTelecom() { + if (this.telecom == null) + this.telecom = new ArrayList(); + return this.telecom; + } + + public boolean hasTelecom() { + if (this.telecom == null) + return false; + for (ContactPoint item : this.telecom) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) + */ + // syntactic sugar + public ContactPoint addTelecom() { //3 + ContactPoint t = new ContactPoint(); + if (this.telecom == null) + this.telecom = new ArrayList(); + this.telecom.add(t); + return t; + } + + /** + * @return {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Enumeration getGenderElement() { + if (this.gender == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.gender"); + else if (Configuration.doAutoCreate()) + this.gender = new Enumeration(); + return this.gender; + } + + public boolean hasGenderElement() { + return this.gender != null && !this.gender.isEmpty(); + } + + public boolean hasGender() { + return this.gender != null && !this.gender.isEmpty(); + } + + /** + * @param value {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value + */ + public Person setGenderElement(Enumeration value) { + this.gender = value; + return this; + } + + /** + * @return Administrative Gender. + */ + public AdministrativeGender getGender() { + return this.gender == null ? null : this.gender.getValue(); + } + + /** + * @param value Administrative Gender. + */ + public Person setGender(AdministrativeGender value) { + if (value == null) + this.gender = null; + else { + if (this.gender == null) + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); + this.gender.setValue(value); + } + return this; + } + + /** + * @return {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public DateTimeType getBirthDateElement() { + if (this.birthDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.birthDate"); + else if (Configuration.doAutoCreate()) + this.birthDate = new DateTimeType(); + return this.birthDate; + } + + public boolean hasBirthDateElement() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + public boolean hasBirthDate() { + return this.birthDate != null && !this.birthDate.isEmpty(); + } + + /** + * @param value {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value + */ + public Person setBirthDateElement(DateTimeType value) { + this.birthDate = value; + return this; + } + + /** + * @return The birth date for the person. + */ + public Date getBirthDate() { + return this.birthDate == null ? null : this.birthDate.getValue(); + } + + /** + * @param value The birth date for the person. + */ + public Person setBirthDate(Date value) { + if (value == null) + this.birthDate = null; + else { + if (this.birthDate == null) + this.birthDate = new DateTimeType(); + this.birthDate.setValue(value); + } + return this; + } + + /** + * @return {@link #address} (One or more addresses for the person.) + */ + public List
      getAddress() { + if (this.address == null) + this.address = new ArrayList
      (); + return this.address; + } + + public boolean hasAddress() { + if (this.address == null) + return false; + for (Address item : this.address) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #address} (One or more addresses for the person.) + */ + // syntactic sugar + public Address addAddress() { //3 + Address t = new Address(); + if (this.address == null) + this.address = new ArrayList
      (); + this.address.add(t); + return t; + } + + /** + * @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) + */ + public Attachment getPhoto() { + if (this.photo == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.photo"); + else if (Configuration.doAutoCreate()) + this.photo = new Attachment(); + return this.photo; + } + + public boolean hasPhoto() { + return this.photo != null && !this.photo.isEmpty(); + } + + /** + * @param value {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) + */ + public Person setPhoto(Attachment value) { + this.photo = value; + return this; + } + + /** + * @return {@link #managingOrganization} (The Organization that is the custodian of the person record.) + */ + public Reference getManagingOrganization() { + if (this.managingOrganization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganization = new Reference(); + return this.managingOrganization; + } + + public boolean hasManagingOrganization() { + return this.managingOrganization != null && !this.managingOrganization.isEmpty(); + } + + /** + * @param value {@link #managingOrganization} (The Organization that is the custodian of the person record.) + */ + public Person setManagingOrganization(Reference value) { + this.managingOrganization = value; + return this; + } + + /** + * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Organization that is the custodian of the person record.) + */ + public Organization getManagingOrganizationTarget() { + if (this.managingOrganizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.managingOrganization"); + else if (Configuration.doAutoCreate()) + this.managingOrganizationTarget = new Organization(); + return this.managingOrganizationTarget; + } + + /** + * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Organization that is the custodian of the person record.) + */ + public Person setManagingOrganizationTarget(Organization value) { + this.managingOrganizationTarget = value; + return this; + } + + /** + * @return {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public BooleanType getActiveElement() { + if (this.active == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create Person.active"); + else if (Configuration.doAutoCreate()) + this.active = new BooleanType(); + return this.active; + } + + public boolean hasActiveElement() { + return this.active != null && !this.active.isEmpty(); + } + + public boolean hasActive() { + return this.active != null && !this.active.isEmpty(); + } + + /** + * @param value {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value + */ + public Person setActiveElement(BooleanType value) { + this.active = value; + return this; + } + + /** + * @return Whether this person's record is in active use. + */ + public boolean getActive() { + return this.active == null ? false : this.active.getValue(); + } + + /** + * @param value Whether this person's record is in active use. + */ + public Person setActive(boolean value) { + if (value == false) + this.active = null; + else { + if (this.active == null) + this.active = new BooleanType(); + this.active.setValue(value); + } + return this; + } + + /** + * @return {@link #link} (Link to a resource that converns the same actual person.) + */ + public List getLink() { + if (this.link == null) + this.link = new ArrayList(); + return this.link; + } + + public boolean hasLink() { + if (this.link == null) + return false; + for (PersonLinkComponent item : this.link) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #link} (Link to a resource that converns the same actual person.) + */ + // syntactic sugar + public PersonLinkComponent addLink() { //3 + PersonLinkComponent t = new PersonLinkComponent(); + if (this.link == null) + this.link = new ArrayList(); + this.link.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); + childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); + childrenList.add(new Property("gender", "code", "Administrative Gender.", 0, java.lang.Integer.MAX_VALUE, gender)); + childrenList.add(new Property("birthDate", "dateTime", "The birth date for the person.", 0, java.lang.Integer.MAX_VALUE, birthDate)); + childrenList.add(new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address)); + childrenList.add(new Property("photo", "Attachment", "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.", 0, java.lang.Integer.MAX_VALUE, photo)); + childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The Organization that is the custodian of the person record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); + childrenList.add(new Property("active", "boolean", "Whether this person's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); + childrenList.add(new Property("link", "", "Link to a resource that converns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link)); + } + + public Person copy() { + Person dst = new Person(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + if (name != null) { + dst.name = new ArrayList(); + for (HumanName i : name) + dst.name.add(i.copy()); + }; + if (telecom != null) { + dst.telecom = new ArrayList(); + for (ContactPoint i : telecom) + dst.telecom.add(i.copy()); + }; + dst.gender = gender == null ? null : gender.copy(); + dst.birthDate = birthDate == null ? null : birthDate.copy(); + if (address != null) { + dst.address = new ArrayList
      (); + for (Address i : address) + dst.address.add(i.copy()); + }; + dst.photo = photo == null ? null : photo.copy(); + dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); + dst.active = active == null ? null : active.copy(); + if (link != null) { + dst.link = new ArrayList(); + for (PersonLinkComponent i : link) + dst.link.add(i.copy()); + }; + return dst; + } + + protected Person typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) + && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) + && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) + && (active == null || active.isEmpty()) && (link == null || link.isEmpty()); + } + + @Override + public ResourceType getResourceType() { + return ResourceType.Person; + } + + @SearchParamDefinition(name="organization", path="Person.managingOrganization", description="The organization at which this person record is being managed", type="reference" ) + public static final String SP_ORGANIZATION = "organization"; + @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) + public static final String SP_PHONETIC = "phonetic"; + @SearchParamDefinition(name="address", path="Person.address", description="An address in any kind of address/part", type="string" ) + public static final String SP_ADDRESS = "address"; + @SearchParamDefinition(name="name", path="Person.name", description="A portion of name in any name part", type="string" ) + public static final String SP_NAME = "name"; + @SearchParamDefinition(name="birthdate", path="Person.birthDate", description="The person's date of birth", type="date" ) + public static final String SP_BIRTHDATE = "birthdate"; + @SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="string" ) + public static final String SP_TELECOM = "telecom"; + @SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" ) + public static final String SP_GENDER = "gender"; + @SearchParamDefinition(name="identifier", path="Person.identifier", description="A patient Identifier", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PharmacyClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PharmacyClaim.java new file mode 100644 index 00000000000..b9e4f8d1992 --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PharmacyClaim.java @@ -0,0 +1,3903 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import java.math.*; +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="PharmacyClaim", profile="http://hl7.org/fhir/Profile/PharmacyClaim") +public class PharmacyClaim extends DomainResource { + + public enum UseLink implements FhirEnum { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + public static final UseLinkEnumFactory ENUM_FACTORY = new UseLinkEnumFactory(); + + public static UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) throws IllegalArgumentException { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement { + /** + * Sequence of diagnosis. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) + protected IntegerType sequence; + + /** + * The diagnosis. + */ + @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -935927954L; + + public DiagnosisComponent() { + super(); + } + + public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agrement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preauthref; + + /** + * The Coverages adjudication details. + */ + @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + private static final long serialVersionUID = 450222500L; + + public CoverageComponent() { + super(); + } + + public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agrement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agrement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreauthref() { + if (this.preauthref == null) + this.preauthref = new ArrayList(); + return this.preauthref; + } + + public boolean hasPreauthref() { + if (this.preauthref == null) + return false; + for (StringType item : this.preauthref) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreauthrefElement() {//2 + StringType t = new StringType(); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return t; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreauthref(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return this; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreauthref(String value) { + if (this.preauthref == null) + return false; + for (StringType v : this.preauthref) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preauthref != null) { + dst.preauthref = new ArrayList(); + for (StringType i : preauthref) + dst.preauthref.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * Diagnosis applicable for this service or product line. + */ + @Child(name="diagnosisLinkId", type={IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis Link", formalDefinition="Diagnosis applicable for this service or product line." ) + protected List diagnosisLinkId; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name="serviceDate", type={DateType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Date of Service", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateType serviceDate; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name="unitPrice", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=11, min=0, max=1) + @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=12, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Physical service site on the patient (limb, tooth, etc). + */ + @Child(name="bodySite", type={Coding.class}, order=13, min=0, max=1) + @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) + protected Coding bodySite; + + /** + * A region or surface of the site, eg. limb region or tooth surface(s). + */ + @Child(name="subsite", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) + protected List subsite; + + /** + * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. + */ + @Child(name="modifier", type={Coding.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." ) + protected List modifier; + + /** + * Second tier of goods and services. + */ + @Child(name="detail", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." ) + protected List detail; + + private static final long serialVersionUID = -1140048455L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + return this.diagnosisLinkId; + } + + public boolean hasDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType item : this.diagnosisLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + // syntactic sugar + public IntegerType addDiagnosisLinkIdElement() {//2 + IntegerType t = new IntegerType(); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return t; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public ItemsComponent addDiagnosisLinkId(int value) { //1 + IntegerType t = new IntegerType(); + t.setValue(value); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return this; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public boolean hasDiagnosisLinkId(int value) { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType v : this.diagnosisLinkId) + if (v.equals(value)) // integer + return true; + return false; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getServiceDate() { + return this.serviceDate == null ? null : this.serviceDate.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public ItemsComponent setServiceDate(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubsite() { + if (this.subsite == null) + this.subsite = new ArrayList(); + return this.subsite; + } + + public boolean hasSubsite() { + if (this.subsite == null) + return false; + for (Coding item : this.subsite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubsite() { //3 + Coding t = new Coding(); + if (this.subsite == null) + this.subsite = new ArrayList(); + this.subsite.add(t); + return t; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("diagnosisLinkId", "integer", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("serviceDate", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviceDate)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + if (diagnosisLinkId != null) { + dst.diagnosisLinkId = new ArrayList(); + for (IntegerType i : diagnosisLinkId) + dst.diagnosisLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + dst.serviceDate = serviceDate == null ? null : serviceDate.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subsite != null) { + dst.subsite = new ArrayList(); + for (Coding i : subsite) + dst.subsite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (provider == null || provider.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) + && (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (subsite == null || subsite.isEmpty()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class DetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -342502025L; + + public DetailComponent() { + super(); + } + + public DetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = 122809194L; + + public SubDetailComponent() { + super(); + } + + public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addtional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()); + } + + } + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name="facility", type={Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Prescription to support the dispensing of pharmacy services, medications or products. + */ + @Child(name="prescription", type={MedicationPrescription.class}, order=11, min=0, max=1) + @Description(shortDefinition="Current Prescription", formalDefinition="Prescription to support the dispensing of pharmacy services, medications or products." ) + protected Reference prescription; + + /** + * The actual object that is the target of the reference (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + protected MedicationPrescription prescriptionTarget; + + /** + * Original prescription to support the dispensing of pharmacy services, medications or products. + */ + @Child(name="originalPrescription", type={MedicationPrescription.class}, order=12, min=0, max=1) + @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription to support the dispensing of pharmacy services, medications or products." ) + protected Reference originalPrescription; + + /** + * The actual object that is the target of the reference (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + protected MedicationPrescription originalPrescriptionTarget; + + /** + * Theparty to be reimbused for the services. + */ + @Child(name="payee", type={}, order=13, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name="referral", type={ReferralRequest.class}, order=14, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name="diagnosis", type={}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name="condition", type={Coding.class}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name="patient", type={Patient.class}, order=17, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=18, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name="exception", type={Coding.class}, order=19, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name="school", type={StringType.class}, order=20, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addessing. + */ + @Child(name="accident", type={DateType.class}, order=21, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name="accidentType", type={Coding.class}, order=22, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name="interventionException", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * First tier of goods and services. + */ + @Child(name="item", type={}, order=24, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name="additionalMaterials", type={Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional materials, documents, etc.", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." ) + protected List additionalMaterials; + + private static final long serialVersionUID = -12435566L; + + public PharmacyClaim() { + super(); + } + + public PharmacyClaim(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public PharmacyClaim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public PharmacyClaim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public PharmacyClaim setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public PharmacyClaim setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public PharmacyClaim setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) + */ + public PharmacyClaim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public PharmacyClaim setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public PharmacyClaim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public PharmacyClaim setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public PharmacyClaim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public PharmacyClaim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public PharmacyClaim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(UseLink.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public PharmacyClaim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public PharmacyClaim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public PharmacyClaim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public PharmacyClaim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public PharmacyClaim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); + return this.facilityTarget; + } + + /** + * @param value {@link #facility} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public PharmacyClaim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #prescription} (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Reference getPrescription() { + if (this.prescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.prescription"); + else if (Configuration.doAutoCreate()) + this.prescription = new Reference(); + return this.prescription; + } + + public boolean hasPrescription() { + return this.prescription != null && !this.prescription.isEmpty(); + } + + /** + * @param value {@link #prescription} (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + public PharmacyClaim setPrescription(Reference value) { + this.prescription = value; + return this; + } + + /** + * @return {@link #prescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + public MedicationPrescription getPrescriptionTarget() { + if (this.prescriptionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.prescription"); + else if (Configuration.doAutoCreate()) + this.prescriptionTarget = new MedicationPrescription(); + return this.prescriptionTarget; + } + + /** + * @param value {@link #prescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Prescription to support the dispensing of pharmacy services, medications or products.) + */ + public PharmacyClaim setPrescriptionTarget(MedicationPrescription value) { + this.prescriptionTarget = value; + return this; + } + + /** + * @return {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public Reference getOriginalPrescription() { + if (this.originalPrescription == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.originalPrescription"); + else if (Configuration.doAutoCreate()) + this.originalPrescription = new Reference(); + return this.originalPrescription; + } + + public boolean hasOriginalPrescription() { + return this.originalPrescription != null && !this.originalPrescription.isEmpty(); + } + + /** + * @param value {@link #originalPrescription} (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public PharmacyClaim setOriginalPrescription(Reference value) { + this.originalPrescription = value; + return this; + } + + /** + * @return {@link #originalPrescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public MedicationPrescription getOriginalPrescriptionTarget() { + if (this.originalPrescriptionTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.originalPrescription"); + else if (Configuration.doAutoCreate()) + this.originalPrescriptionTarget = new MedicationPrescription(); + return this.originalPrescriptionTarget; + } + + /** + * @param value {@link #originalPrescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original prescription to support the dispensing of pharmacy services, medications or products.) + */ + public PharmacyClaim setOriginalPrescriptionTarget(MedicationPrescription value) { + this.originalPrescriptionTarget = value; + return this; + } + + /** + * @return {@link #payee} (Theparty to be reimbused for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Theparty to be reimbused for the services.) + */ + public PharmacyClaim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public PharmacyClaim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public PharmacyClaim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient Resource.) + */ + public PharmacyClaim setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public PharmacyClaim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public PharmacyClaim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public PharmacyClaim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public PharmacyClaim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addessing. + */ + public Date getAccident() { + return this.accident == null ? null : this.accident.getValue(); + } + + /** + * @param value Date of an accident which these services are addessing. + */ + public PharmacyClaim setAccident(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PharmacyClaim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public PharmacyClaim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("prescription", "Reference(MedicationPrescription)", "Prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, prescription)); + childrenList.add(new Property("originalPrescription", "Reference(MedicationPrescription)", "Original prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); + childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + } + + public PharmacyClaim copy() { + PharmacyClaim dst = new PharmacyClaim(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.target = target == null ? null : target.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.prescription = prescription == null ? null : prescription.copy(); + dst.originalPrescription = originalPrescription == null ? null : originalPrescription.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + return dst; + } + + protected PharmacyClaim typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) && (fundsReserve == null || fundsReserve.isEmpty()) + && (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) && (prescription == null || prescription.isEmpty()) + && (originalPrescription == null || originalPrescription.isEmpty()) && (payee == null || payee.isEmpty()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.PharmacyClaim; + } + + @SearchParamDefinition(name="patient", path="PharmacyClaim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="PharmacyClaim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="use", path="PharmacyClaim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="identifier", path="PharmacyClaim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Practitioner.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Practitioner.java index 08c288e2b4d..a3cc8228e8f 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Practitioner.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Practitioner.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Practitioner", profile="http://hl7.org/fhir/Profile/Practitioner") public class Practitioner extends DomainResource { - public enum AdministrativeGender { + public enum AdministrativeGender implements FhirEnum { /** * Male */ @@ -66,7 +66,10 @@ public class Practitioner extends DomainResource { * added to help the parsers */ NULL; - public static AdministrativeGender fromCode(String codeString) throws Exception { + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("male".equals(codeString)) @@ -77,8 +80,9 @@ public class Practitioner extends DomainResource { return OTHER; if ("unknown".equals(codeString)) return UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case MALE: return "male"; @@ -117,8 +121,8 @@ public class Practitioner extends DomainResource { } } - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class Practitioner extends DomainResource { return AdministrativeGender.OTHER; if ("unknown".equals(codeString)) return AdministrativeGender.UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AdministrativeGender code) throws IllegalArgumentException { if (code == AdministrativeGender.MALE) return "male"; if (code == AdministrativeGender.FEMALE) @@ -613,7 +617,7 @@ public class Practitioner extends DomainResource { this.gender = null; else { if (this.gender == null) - this.gender = new Enumeration(); + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); this.gender.setValue(value); } return this; @@ -650,14 +654,14 @@ public class Practitioner extends DomainResource { /** * @return The date and time of birth for the practitioner. */ - public DateAndTime getBirthDate() { + public Date getBirthDate() { return this.birthDate == null ? null : this.birthDate.getValue(); } /** * @param value The date and time of birth for the practitioner. */ - public Practitioner setBirthDate(DateAndTime value) { + public Practitioner setBirthDate(Date value) { if (value == null) this.birthDate = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java index 567870fc309..20b77cc7dae 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/PrimitiveType.java @@ -3,9 +3,6 @@ package org.hl7.fhir.instance.model; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; -import ca.uhn.fhir.model.api.BasePrimitive; -import ca.uhn.fhir.parser.DataFormatException; - public abstract class PrimitiveType extends Type { private static final long serialVersionUID = 2L; @@ -22,7 +19,7 @@ public abstract class PrimitiveType extends Type { return false; } - BasePrimitive o = (BasePrimitive) theObj; + PrimitiveType o = (PrimitiveType) theObj; EqualsBuilder b = new EqualsBuilder(); b.append(getValue(), o.getValue()); @@ -33,7 +30,7 @@ public abstract class PrimitiveType extends Type { return myCoercedValue; } - public String asStringValue() throws DataFormatException { + public String asStringValue() { return myStringValue; } @@ -47,9 +44,10 @@ public abstract class PrimitiveType extends Type { return super.isEmpty() && getValue() == null; } - public void setValue(T theValue) throws DataFormatException { + public PrimitiveType setValue(T theValue) { myCoercedValue = theValue; updateStringValue(); + return this; } protected void updateStringValue() { @@ -61,7 +59,7 @@ public abstract class PrimitiveType extends Type { } } - public void fromStringValue(String theValue) throws DataFormatException { + public void fromStringValue(String theValue) { if (theValue == null) { myCoercedValue = null; } else { @@ -105,4 +103,13 @@ public abstract class PrimitiveType extends Type { public void setValueAsString(String theValue) { fromStringValue(theValue); } + + + protected Type typedCopy() { + return copy(); + } + + public abstract Type copy(); + + } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Procedure.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Procedure.java index bd48edbcc92..bd1da137fb3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Procedure.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Procedure.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Procedure", profile="http://hl7.org/fhir/Profile/Procedure") public class Procedure extends DomainResource { - public enum ProcedureRelationshipType { + public enum ProcedureRelationshipType implements FhirEnum { /** * This procedure had to be performed because of the related one. */ @@ -58,15 +58,19 @@ public class Procedure extends DomainResource { * added to help the parsers */ NULL; - public static ProcedureRelationshipType fromCode(String codeString) throws Exception { + + public static final ProcedureRelationshipTypeEnumFactory ENUM_FACTORY = new ProcedureRelationshipTypeEnumFactory(); + + public static ProcedureRelationshipType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("caused-by".equals(codeString)) return CAUSEDBY; if ("because-of".equals(codeString)) return BECAUSEOF; - throw new Exception("Unknown ProcedureRelationshipType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProcedureRelationshipType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case CAUSEDBY: return "caused-by"; @@ -97,8 +101,8 @@ public class Procedure extends DomainResource { } } - public static class ProcedureRelationshipTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ProcedureRelationshipTypeEnumFactory implements EnumFactory { + public ProcedureRelationshipType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -106,9 +110,9 @@ public class Procedure extends DomainResource { return ProcedureRelationshipType.CAUSEDBY; if ("because-of".equals(codeString)) return ProcedureRelationshipType.BECAUSEOF; - throw new Exception("Unknown ProcedureRelationshipType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProcedureRelationshipType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ProcedureRelationshipType code) throws IllegalArgumentException { if (code == ProcedureRelationshipType.CAUSEDBY) return "caused-by"; if (code == ProcedureRelationshipType.BECAUSEOF) @@ -303,7 +307,7 @@ public class Procedure extends DomainResource { this.type = null; else { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(ProcedureRelationshipType.ENUM_FACTORY); this.type.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java index 5f199506867..46d4172685b 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProcedureRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="ProcedureRequest", profile="http://hl7.org/fhir/Profile/ProcedureRequest") public class ProcedureRequest extends DomainResource { - public enum ProcedureRequestStatus { + public enum ProcedureRequestStatus implements FhirEnum { /** * The request has been placed. */ @@ -86,7 +86,10 @@ public class ProcedureRequest extends DomainResource { * added to help the parsers */ NULL; - public static ProcedureRequestStatus fromCode(String codeString) throws Exception { + + public static final ProcedureRequestStatusEnumFactory ENUM_FACTORY = new ProcedureRequestStatusEnumFactory(); + + public static ProcedureRequestStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("requested".equals(codeString)) @@ -107,8 +110,9 @@ public class ProcedureRequest extends DomainResource { return REJECTED; if ("failed".equals(codeString)) return FAILED; - throw new Exception("Unknown ProcedureRequestStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProcedureRequestStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUESTED: return "requested"; @@ -167,8 +171,8 @@ public class ProcedureRequest extends DomainResource { } } - public static class ProcedureRequestStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ProcedureRequestStatusEnumFactory implements EnumFactory { + public ProcedureRequestStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -190,9 +194,9 @@ public class ProcedureRequest extends DomainResource { return ProcedureRequestStatus.REJECTED; if ("failed".equals(codeString)) return ProcedureRequestStatus.FAILED; - throw new Exception("Unknown ProcedureRequestStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProcedureRequestStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ProcedureRequestStatus code) throws IllegalArgumentException { if (code == ProcedureRequestStatus.REQUESTED) return "requested"; if (code == ProcedureRequestStatus.RECEIVED) @@ -215,7 +219,7 @@ public class ProcedureRequest extends DomainResource { } } - public enum ProcedureRequestMode { + public enum ProcedureRequestMode implements FhirEnum { /** * planned. */ @@ -232,7 +236,10 @@ public class ProcedureRequest extends DomainResource { * added to help the parsers */ NULL; - public static ProcedureRequestMode fromCode(String codeString) throws Exception { + + public static final ProcedureRequestModeEnumFactory ENUM_FACTORY = new ProcedureRequestModeEnumFactory(); + + public static ProcedureRequestMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("planned".equals(codeString)) @@ -241,8 +248,9 @@ public class ProcedureRequest extends DomainResource { return PROPOSED; if ("ordered".equals(codeString)) return ORDERED; - throw new Exception("Unknown ProcedureRequestMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProcedureRequestMode code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PLANNED: return "planned"; @@ -277,8 +285,8 @@ public class ProcedureRequest extends DomainResource { } } - public static class ProcedureRequestModeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ProcedureRequestModeEnumFactory implements EnumFactory { + public ProcedureRequestMode fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -288,9 +296,9 @@ public class ProcedureRequest extends DomainResource { return ProcedureRequestMode.PROPOSED; if ("ordered".equals(codeString)) return ProcedureRequestMode.ORDERED; - throw new Exception("Unknown ProcedureRequestMode code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProcedureRequestMode code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ProcedureRequestMode code) throws IllegalArgumentException { if (code == ProcedureRequestMode.PLANNED) return "planned"; if (code == ProcedureRequestMode.PROPOSED) @@ -301,7 +309,7 @@ public class ProcedureRequest extends DomainResource { } } - public enum ProcedureRequestPriority { + public enum ProcedureRequestPriority implements FhirEnum { /** * The request has a normal priority. */ @@ -322,7 +330,10 @@ public class ProcedureRequest extends DomainResource { * added to help the parsers */ NULL; - public static ProcedureRequestPriority fromCode(String codeString) throws Exception { + + public static final ProcedureRequestPriorityEnumFactory ENUM_FACTORY = new ProcedureRequestPriorityEnumFactory(); + + public static ProcedureRequestPriority fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("routine".equals(codeString)) @@ -333,8 +344,9 @@ public class ProcedureRequest extends DomainResource { return STAT; if ("asap".equals(codeString)) return ASAP; - throw new Exception("Unknown ProcedureRequestPriority code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case ROUTINE: return "routine"; @@ -373,8 +385,8 @@ public class ProcedureRequest extends DomainResource { } } - public static class ProcedureRequestPriorityEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ProcedureRequestPriorityEnumFactory implements EnumFactory { + public ProcedureRequestPriority fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -386,9 +398,9 @@ public class ProcedureRequest extends DomainResource { return ProcedureRequestPriority.STAT; if ("asap".equals(codeString)) return ProcedureRequestPriority.ASAP; - throw new Exception("Unknown ProcedureRequestPriority code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ProcedureRequestPriority code) throws IllegalArgumentException { if (code == ProcedureRequestPriority.ROUTINE) return "routine"; if (code == ProcedureRequestPriority.URGENT) @@ -868,7 +880,7 @@ public class ProcedureRequest extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ProcedureRequestStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -917,7 +929,7 @@ public class ProcedureRequest extends DomainResource { this.mode = null; else { if (this.mode == null) - this.mode = new Enumeration(); + this.mode = new Enumeration(ProcedureRequestMode.ENUM_FACTORY); this.mode.setValue(value); } return this; @@ -1045,14 +1057,14 @@ public class ProcedureRequest extends DomainResource { /** * @return The time when the request was made. */ - public DateAndTime getOrderedOn() { + public Date getOrderedOn() { return this.orderedOn == null ? null : this.orderedOn.getValue(); } /** * @param value The time when the request was made. */ - public ProcedureRequest setOrderedOn(DateAndTime value) { + public ProcedureRequest setOrderedOn(Date value) { if (value == null) this.orderedOn = null; else { @@ -1145,7 +1157,7 @@ public class ProcedureRequest extends DomainResource { this.priority = null; else { if (this.priority == null) - this.priority = new Enumeration(); + this.priority = new Enumeration(ProcedureRequestPriority.ENUM_FACTORY); this.priority.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProfessionalClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProfessionalClaim.java new file mode 100644 index 00000000000..2aed793b3f9 --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ProfessionalClaim.java @@ -0,0 +1,3786 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import java.math.*; +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="ProfessionalClaim", profile="http://hl7.org/fhir/Profile/ProfessionalClaim") +public class ProfessionalClaim extends DomainResource { + + public enum UseLink implements FhirEnum { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + public static final UseLinkEnumFactory ENUM_FACTORY = new UseLinkEnumFactory(); + + public static UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) throws IllegalArgumentException { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement { + /** + * Sequence of diagnosis. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) + protected IntegerType sequence; + + /** + * The diagnosis. + */ + @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -935927954L; + + public DiagnosisComponent() { + super(); + } + + public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agrement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preauthref; + + /** + * The Coverages adjudication details. + */ + @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + private static final long serialVersionUID = 450222500L; + + public CoverageComponent() { + super(); + } + + public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agrement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agrement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreauthref() { + if (this.preauthref == null) + this.preauthref = new ArrayList(); + return this.preauthref; + } + + public boolean hasPreauthref() { + if (this.preauthref == null) + return false; + for (StringType item : this.preauthref) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreauthrefElement() {//2 + StringType t = new StringType(); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return t; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreauthref(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return this; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreauthref(String value) { + if (this.preauthref == null) + return false; + for (StringType v : this.preauthref) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preauthref != null) { + dst.preauthref = new ArrayList(); + for (StringType i : preauthref) + dst.preauthref.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * Diagnosis applicable for this service or product line. + */ + @Child(name="diagnosisLinkId", type={IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis Link", formalDefinition="Diagnosis applicable for this service or product line." ) + protected List diagnosisLinkId; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name="serviceDate", type={DateType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Date of Service", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateType serviceDate; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name="unitPrice", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=11, min=0, max=1) + @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=12, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Physical service site on the patient (limb, tooth, etc). + */ + @Child(name="bodySite", type={Coding.class}, order=13, min=0, max=1) + @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) + protected Coding bodySite; + + /** + * A region or surface of the site, eg. limb region or tooth surface(s). + */ + @Child(name="subsite", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) + protected List subsite; + + /** + * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. + */ + @Child(name="modifier", type={Coding.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." ) + protected List modifier; + + /** + * Second tier of goods and services. + */ + @Child(name="detail", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." ) + protected List detail; + + private static final long serialVersionUID = -1140048455L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + return this.diagnosisLinkId; + } + + public boolean hasDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType item : this.diagnosisLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + // syntactic sugar + public IntegerType addDiagnosisLinkIdElement() {//2 + IntegerType t = new IntegerType(); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return t; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public ItemsComponent addDiagnosisLinkId(int value) { //1 + IntegerType t = new IntegerType(); + t.setValue(value); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return this; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public boolean hasDiagnosisLinkId(int value) { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType v : this.diagnosisLinkId) + if (v.equals(value)) // integer + return true; + return false; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getServiceDate() { + return this.serviceDate == null ? null : this.serviceDate.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public ItemsComponent setServiceDate(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubsite() { + if (this.subsite == null) + this.subsite = new ArrayList(); + return this.subsite; + } + + public boolean hasSubsite() { + if (this.subsite == null) + return false; + for (Coding item : this.subsite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubsite() { //3 + Coding t = new Coding(); + if (this.subsite == null) + this.subsite = new ArrayList(); + this.subsite.add(t); + return t; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("diagnosisLinkId", "integer", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("serviceDate", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviceDate)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + if (diagnosisLinkId != null) { + dst.diagnosisLinkId = new ArrayList(); + for (IntegerType i : diagnosisLinkId) + dst.diagnosisLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + dst.serviceDate = serviceDate == null ? null : serviceDate.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subsite != null) { + dst.subsite = new ArrayList(); + for (Coding i : subsite) + dst.subsite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (provider == null || provider.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) + && (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (subsite == null || subsite.isEmpty()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class DetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -342502025L; + + public DetailComponent() { + super(); + } + + public DetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = 122809194L; + + public SubDetailComponent() { + super(); + } + + public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addtional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()); + } + + } + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name="facility", type={Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Theparty to be reimbused for the services. + */ + @Child(name="payee", type={}, order=11, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name="school", type={StringType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addessing. + */ + @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * First tier of goods and services. + */ + @Child(name="item", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name="additionalMaterials", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional materials, documents, etc.", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." ) + protected List additionalMaterials; + + private static final long serialVersionUID = 1113876752L; + + public ProfessionalClaim() { + super(); + } + + public ProfessionalClaim(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public ProfessionalClaim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public ProfessionalClaim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public ProfessionalClaim setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public ProfessionalClaim setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public ProfessionalClaim setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) + */ + public ProfessionalClaim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public ProfessionalClaim setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public ProfessionalClaim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public ProfessionalClaim setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public ProfessionalClaim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public ProfessionalClaim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public ProfessionalClaim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(UseLink.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public ProfessionalClaim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public ProfessionalClaim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public ProfessionalClaim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public ProfessionalClaim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public ProfessionalClaim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); + return this.facilityTarget; + } + + /** + * @param value {@link #facility} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public ProfessionalClaim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #payee} (Theparty to be reimbused for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Theparty to be reimbused for the services.) + */ + public ProfessionalClaim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ProfessionalClaim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ProfessionalClaim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient Resource.) + */ + public ProfessionalClaim setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public ProfessionalClaim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public ProfessionalClaim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public ProfessionalClaim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public ProfessionalClaim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addessing. + */ + public Date getAccident() { + return this.accident == null ? null : this.accident.getValue(); + } + + /** + * @param value Date of an accident which these services are addessing. + */ + public ProfessionalClaim setAccident(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ProfessionalClaim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public ProfessionalClaim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + } + + public ProfessionalClaim copy() { + ProfessionalClaim dst = new ProfessionalClaim(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.target = target == null ? null : target.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + return dst; + } + + protected ProfessionalClaim typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) && (fundsReserve == null || fundsReserve.isEmpty()) + && (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) && (payee == null || payee.isEmpty()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.ProfessionalClaim; + } + + @SearchParamDefinition(name="patient", path="ProfessionalClaim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="ProfessionalClaim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="use", path="ProfessionalClaim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="identifier", path="ProfessionalClaim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Profile.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Profile.java index 3c6cc017fc4..7ce305edf80 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Profile.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Profile.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Profile", profile="http://hl7.org/fhir/Profile/Profile") public class Profile extends DomainResource { - public enum ResourceProfileStatus { + public enum ResourceProfileStatus implements FhirEnum { /** * This profile is still under development. */ @@ -62,7 +62,10 @@ public class Profile extends DomainResource { * added to help the parsers */ NULL; - public static ResourceProfileStatus fromCode(String codeString) throws Exception { + + public static final ResourceProfileStatusEnumFactory ENUM_FACTORY = new ResourceProfileStatusEnumFactory(); + + public static ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("draft".equals(codeString)) @@ -71,8 +74,9 @@ public class Profile extends DomainResource { return ACTIVE; if ("retired".equals(codeString)) return RETIRED; - throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DRAFT: return "draft"; @@ -107,8 +111,8 @@ public class Profile extends DomainResource { } } - public static class ResourceProfileStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ResourceProfileStatusEnumFactory implements EnumFactory { + public ResourceProfileStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class Profile extends DomainResource { return ResourceProfileStatus.ACTIVE; if ("retired".equals(codeString)) return ResourceProfileStatus.RETIRED; - throw new Exception("Unknown ResourceProfileStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ResourceProfileStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ResourceProfileStatus code) throws IllegalArgumentException { if (code == ResourceProfileStatus.DRAFT) return "draft"; if (code == ResourceProfileStatus.ACTIVE) @@ -963,7 +967,7 @@ public class Profile extends DomainResource { */ public Profile setStatus(ResourceProfileStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ResourceProfileStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1048,14 +1052,14 @@ public class Profile extends DomainResource { /** * @return The date that this version of the profile was published. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date that this version of the profile was published. */ - public Profile setDate(DateAndTime value) { + public Profile setDate(Date value) { if (value == null) this.date = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Provenance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Provenance.java index e3625040f4b..01c1c6a961a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Provenance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Provenance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Provenance", profile="http://hl7.org/fhir/Profile/Provenance") public class Provenance extends DomainResource { - public enum ProvenanceEntityRole { + public enum ProvenanceEntityRole implements FhirEnum { /** * A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity. */ @@ -66,7 +66,10 @@ public class Provenance extends DomainResource { * added to help the parsers */ NULL; - public static ProvenanceEntityRole fromCode(String codeString) throws Exception { + + public static final ProvenanceEntityRoleEnumFactory ENUM_FACTORY = new ProvenanceEntityRoleEnumFactory(); + + public static ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("derivation".equals(codeString)) @@ -77,8 +80,9 @@ public class Provenance extends DomainResource { return QUOTATION; if ("source".equals(codeString)) return SOURCE; - throw new Exception("Unknown ProvenanceEntityRole code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DERIVATION: return "derivation"; @@ -117,8 +121,8 @@ public class Provenance extends DomainResource { } } - public static class ProvenanceEntityRoleEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ProvenanceEntityRoleEnumFactory implements EnumFactory { + public ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class Provenance extends DomainResource { return ProvenanceEntityRole.QUOTATION; if ("source".equals(codeString)) return ProvenanceEntityRole.SOURCE; - throw new Exception("Unknown ProvenanceEntityRole code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ProvenanceEntityRole code) throws IllegalArgumentException { if (code == ProvenanceEntityRole.DERIVATION) return "derivation"; if (code == ProvenanceEntityRole.REVISION) @@ -445,7 +449,7 @@ public class Provenance extends DomainResource { */ public ProvenanceEntityComponent setRole(ProvenanceEntityRole value) { if (this.role == null) - this.role = new Enumeration(); + this.role = new Enumeration(ProvenanceEntityRole.ENUM_FACTORY); this.role.setValue(value); return this; } @@ -798,14 +802,14 @@ public class Provenance extends DomainResource { /** * @return The instant of time at which the activity was recorded. */ - public DateAndTime getRecorded() { + public Date getRecorded() { return this.recorded == null ? null : this.recorded.getValue(); } /** * @param value The instant of time at which the activity was recorded. */ - public Provenance setRecorded(DateAndTime value) { + public Provenance setRecorded(Date value) { if (this.recorded == null) this.recorded = new InstantType(); this.recorded.setValue(value); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Quantity.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Quantity.java index a2628399240..777dbec7de5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Quantity.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Quantity.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -44,7 +44,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef; @DatatypeDef(name="Quantity") public class Quantity extends Type { - public enum QuantityComparator { + public enum QuantityComparator implements FhirEnum { /** * The actual value is less than the given value. */ @@ -65,7 +65,10 @@ public class Quantity extends Type { * added to help the parsers */ NULL; - public static QuantityComparator fromCode(String codeString) throws Exception { + + public static final QuantityComparatorEnumFactory ENUM_FACTORY = new QuantityComparatorEnumFactory(); + + public static QuantityComparator fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("<".equals(codeString)) @@ -76,8 +79,9 @@ public class Quantity extends Type { return GREATER_OR_EQUAL; if (">".equals(codeString)) return GREATER_THAN; - throw new Exception("Unknown QuantityComparator code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case LESS_THAN: return "<"; @@ -116,8 +120,8 @@ public class Quantity extends Type { } } - public static class QuantityComparatorEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class QuantityComparatorEnumFactory implements EnumFactory { + public QuantityComparator fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -129,9 +133,9 @@ public class Quantity extends Type { return QuantityComparator.GREATER_OR_EQUAL; if (">".equals(codeString)) return QuantityComparator.GREATER_THAN; - throw new Exception("Unknown QuantityComparator code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(QuantityComparator code) throws IllegalArgumentException { if (code == QuantityComparator.LESS_THAN) return "<"; if (code == QuantityComparator.LESS_OR_EQUAL) @@ -277,7 +281,7 @@ public class Quantity extends Type { this.comparator = null; else { if (this.comparator == null) - this.comparator = new Enumeration(); + this.comparator = new Enumeration(QuantityComparator.ENUM_FACTORY); this.comparator.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Query.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Query.java deleted file mode 100644 index 7a31ba690a1..00000000000 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Query.java +++ /dev/null @@ -1,790 +0,0 @@ -package org.hl7.fhir.instance.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.instance.model.annotations.ResourceDef; -import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; -import org.hl7.fhir.instance.model.annotations.Block; -import org.hl7.fhir.instance.model.annotations.Child; -import org.hl7.fhir.instance.model.annotations.Description; -/** - * A description of a query with a set of parameters. - */ -@ResourceDef(name="Query", profile="http://hl7.org/fhir/Profile/Query") -public class Query extends DomainResource { - - public enum QueryOutcome { - /** - * The query was processed successfully. - */ - OK, - /** - * The query was processed successfully, but some additional limitations were added. - */ - LIMITED, - /** - * The server refused to process the query. - */ - REFUSED, - /** - * The server tried to process the query, but some error occurred. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - public static QueryOutcome fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return OK; - if ("limited".equals(codeString)) - return LIMITED; - if ("refused".equals(codeString)) - return REFUSED; - if ("error".equals(codeString)) - return ERROR; - throw new Exception("Unknown QueryOutcome code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OK: return "ok"; - case LIMITED: return "limited"; - case REFUSED: return "refused"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OK: return ""; - case LIMITED: return ""; - case REFUSED: return ""; - case ERROR: return ""; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OK: return "The query was processed successfully."; - case LIMITED: return "The query was processed successfully, but some additional limitations were added."; - case REFUSED: return "The server refused to process the query."; - case ERROR: return "The server tried to process the query, but some error occurred."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OK: return "ok"; - case LIMITED: return "limited"; - case REFUSED: return "refused"; - case ERROR: return "error"; - default: return "?"; - } - } - } - - public static class QueryOutcomeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return QueryOutcome.OK; - if ("limited".equals(codeString)) - return QueryOutcome.LIMITED; - if ("refused".equals(codeString)) - return QueryOutcome.REFUSED; - if ("error".equals(codeString)) - return QueryOutcome.ERROR; - throw new Exception("Unknown QueryOutcome code '"+codeString+"'"); - } - public String toCode(Enum code) throws Exception { - if (code == QueryOutcome.OK) - return "ok"; - if (code == QueryOutcome.LIMITED) - return "limited"; - if (code == QueryOutcome.REFUSED) - return "refused"; - if (code == QueryOutcome.ERROR) - return "error"; - return "?"; - } - } - - @Block() - public static class QueryResponseComponent extends BackboneElement { - /** - * Links response to source query. - */ - @Child(name="identifier", type={UriType.class}, order=1, min=1, max=1) - @Description(shortDefinition="Links response to source query", formalDefinition="Links response to source query." ) - protected UriType identifier; - - /** - * Outcome of processing the query. - */ - @Child(name="outcome", type={CodeType.class}, order=2, min=1, max=1) - @Description(shortDefinition="ok | limited | refused | error", formalDefinition="Outcome of processing the query." ) - protected Enumeration outcome; - - /** - * Total number of matching records. - */ - @Child(name="total", type={IntegerType.class}, order=3, min=0, max=1) - @Description(shortDefinition="Total number of matching records", formalDefinition="Total number of matching records." ) - protected IntegerType total; - - /** - * Parameters server used. - */ - @Child(name="parameter", type={Extension.class}, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Parameters server used", formalDefinition="Parameters server used." ) - protected List parameter; - - /** - * To get first page (if paged). - */ - @Child(name="first", type={Extension.class}, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="To get first page (if paged)", formalDefinition="To get first page (if paged)." ) - protected List first; - - /** - * To get previous page (if paged). - */ - @Child(name="previous", type={Extension.class}, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="To get previous page (if paged)", formalDefinition="To get previous page (if paged)." ) - protected List previous; - - /** - * To get next page (if paged). - */ - @Child(name="next", type={Extension.class}, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="To get next page (if paged)", formalDefinition="To get next page (if paged)." ) - protected List next; - - /** - * To get last page (if paged). - */ - @Child(name="last", type={Extension.class}, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="To get last page (if paged)", formalDefinition="To get last page (if paged)." ) - protected List last; - - /** - * Resources that are the results of the search. - */ - @Child(name="reference", type={}, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Resources that are the results of the search", formalDefinition="Resources that are the results of the search." ) - protected List reference; - /** - * The actual objects that are the target of the reference (Resources that are the results of the search.) - */ - protected List referenceTarget; - - - private static final long serialVersionUID = 811744396L; - - public QueryResponseComponent() { - super(); - } - - public QueryResponseComponent(UriType identifier, Enumeration outcome) { - super(); - this.identifier = identifier; - this.outcome = outcome; - } - - /** - * @return {@link #identifier} (Links response to source query.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public UriType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QueryResponseComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new UriType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Links response to source query.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public QueryResponseComponent setIdentifierElement(UriType value) { - this.identifier = value; - return this; - } - - /** - * @return Links response to source query. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value Links response to source query. - */ - public QueryResponseComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new UriType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #outcome} (Outcome of processing the query.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QueryResponseComponent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(); - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Outcome of processing the query.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public QueryResponseComponent setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Outcome of processing the query. - */ - public QueryOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Outcome of processing the query. - */ - public QueryResponseComponent setOutcome(QueryOutcome value) { - if (this.outcome == null) - this.outcome = new Enumeration(); - this.outcome.setValue(value); - return this; - } - - /** - * @return {@link #total} (Total number of matching records.). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public IntegerType getTotalElement() { - if (this.total == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QueryResponseComponent.total"); - else if (Configuration.doAutoCreate()) - this.total = new IntegerType(); - return this.total; - } - - public boolean hasTotalElement() { - return this.total != null && !this.total.isEmpty(); - } - - public boolean hasTotal() { - return this.total != null && !this.total.isEmpty(); - } - - /** - * @param value {@link #total} (Total number of matching records.). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public QueryResponseComponent setTotalElement(IntegerType value) { - this.total = value; - return this; - } - - /** - * @return Total number of matching records. - */ - public int getTotal() { - return this.total == null ? null : this.total.getValue(); - } - - /** - * @param value Total number of matching records. - */ - public QueryResponseComponent setTotal(int value) { - if (value == -1) - this.total = null; - else { - if (this.total == null) - this.total = new IntegerType(); - this.total.setValue(value); - } - return this; - } - - /** - * @return {@link #parameter} (Parameters server used.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (Extension item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (Parameters server used.) - */ - // syntactic sugar - public Extension addParameter() { //3 - Extension t = new Extension(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - /** - * @return {@link #first} (To get first page (if paged).) - */ - public List getFirst() { - if (this.first == null) - this.first = new ArrayList(); - return this.first; - } - - public boolean hasFirst() { - if (this.first == null) - return false; - for (Extension item : this.first) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #first} (To get first page (if paged).) - */ - // syntactic sugar - public Extension addFirst() { //3 - Extension t = new Extension(); - if (this.first == null) - this.first = new ArrayList(); - this.first.add(t); - return t; - } - - /** - * @return {@link #previous} (To get previous page (if paged).) - */ - public List getPrevious() { - if (this.previous == null) - this.previous = new ArrayList(); - return this.previous; - } - - public boolean hasPrevious() { - if (this.previous == null) - return false; - for (Extension item : this.previous) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #previous} (To get previous page (if paged).) - */ - // syntactic sugar - public Extension addPrevious() { //3 - Extension t = new Extension(); - if (this.previous == null) - this.previous = new ArrayList(); - this.previous.add(t); - return t; - } - - /** - * @return {@link #next} (To get next page (if paged).) - */ - public List getNext() { - if (this.next == null) - this.next = new ArrayList(); - return this.next; - } - - public boolean hasNext() { - if (this.next == null) - return false; - for (Extension item : this.next) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #next} (To get next page (if paged).) - */ - // syntactic sugar - public Extension addNext() { //3 - Extension t = new Extension(); - if (this.next == null) - this.next = new ArrayList(); - this.next.add(t); - return t; - } - - /** - * @return {@link #last} (To get last page (if paged).) - */ - public List getLast() { - if (this.last == null) - this.last = new ArrayList(); - return this.last; - } - - public boolean hasLast() { - if (this.last == null) - return false; - for (Extension item : this.last) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #last} (To get last page (if paged).) - */ - // syntactic sugar - public Extension addLast() { //3 - Extension t = new Extension(); - if (this.last == null) - this.last = new ArrayList(); - this.last.add(t); - return t; - } - - /** - * @return {@link #reference} (Resources that are the results of the search.) - */ - public List getReference() { - if (this.reference == null) - this.reference = new ArrayList(); - return this.reference; - } - - public boolean hasReference() { - if (this.reference == null) - return false; - for (Reference item : this.reference) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reference} (Resources that are the results of the search.) - */ - // syntactic sugar - public Reference addReference() { //3 - Reference t = new Reference(); - if (this.reference == null) - this.reference = new ArrayList(); - this.reference.add(t); - return t; - } - - /** - * @return {@link #reference} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Resources that are the results of the search.) - */ - public List getReferenceTarget() { - if (this.referenceTarget == null) - this.referenceTarget = new ArrayList(); - return this.referenceTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "uri", "Links response to source query.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("outcome", "code", "Outcome of processing the query.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("total", "integer", "Total number of matching records.", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("parameter", "Extension", "Parameters server used.", 0, java.lang.Integer.MAX_VALUE, parameter)); - childrenList.add(new Property("first", "Extension", "To get first page (if paged).", 0, java.lang.Integer.MAX_VALUE, first)); - childrenList.add(new Property("previous", "Extension", "To get previous page (if paged).", 0, java.lang.Integer.MAX_VALUE, previous)); - childrenList.add(new Property("next", "Extension", "To get next page (if paged).", 0, java.lang.Integer.MAX_VALUE, next)); - childrenList.add(new Property("last", "Extension", "To get last page (if paged).", 0, java.lang.Integer.MAX_VALUE, last)); - childrenList.add(new Property("reference", "Reference(Any)", "Resources that are the results of the search.", 0, java.lang.Integer.MAX_VALUE, reference)); - } - - public QueryResponseComponent copy() { - QueryResponseComponent dst = new QueryResponseComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.total = total == null ? null : total.copy(); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (Extension i : parameter) - dst.parameter.add(i.copy()); - }; - if (first != null) { - dst.first = new ArrayList(); - for (Extension i : first) - dst.first.add(i.copy()); - }; - if (previous != null) { - dst.previous = new ArrayList(); - for (Extension i : previous) - dst.previous.add(i.copy()); - }; - if (next != null) { - dst.next = new ArrayList(); - for (Extension i : next) - dst.next.add(i.copy()); - }; - if (last != null) { - dst.last = new ArrayList(); - for (Extension i : last) - dst.last.add(i.copy()); - }; - if (reference != null) { - dst.reference = new ArrayList(); - for (Reference i : reference) - dst.reference.add(i.copy()); - }; - return dst; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (outcome == null || outcome.isEmpty()) - && (total == null || total.isEmpty()) && (parameter == null || parameter.isEmpty()) && (first == null || first.isEmpty()) - && (previous == null || previous.isEmpty()) && (next == null || next.isEmpty()) && (last == null || last.isEmpty()) - && (reference == null || reference.isEmpty()); - } - - } - - /** - * Links query and its response(s). - */ - @Child(name="identifier", type={UriType.class}, order=-1, min=1, max=1) - @Description(shortDefinition="Links query and its response(s)", formalDefinition="Links query and its response(s)." ) - protected UriType identifier; - - /** - * Set of query parameters with values. - */ - @Child(name="parameter", type={Extension.class}, order=0, min=1, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Set of query parameters with values", formalDefinition="Set of query parameters with values." ) - protected List parameter; - - /** - * If this is a response to a query. - */ - @Child(name="response", type={}, order=1, min=0, max=1) - @Description(shortDefinition="If this is a response to a query", formalDefinition="If this is a response to a query." ) - protected QueryResponseComponent response; - - private static final long serialVersionUID = -73456284L; - - public Query() { - super(); - } - - public Query(UriType identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #identifier} (Links query and its response(s).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public UriType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Query.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new UriType(); - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Links query and its response(s).). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public Query setIdentifierElement(UriType value) { - this.identifier = value; - return this; - } - - /** - * @return Links query and its response(s). - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value Links query and its response(s). - */ - public Query setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new UriType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #parameter} (Set of query parameters with values.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (Extension item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (Set of query parameters with values.) - */ - // syntactic sugar - public Extension addParameter() { //3 - Extension t = new Extension(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - /** - * @return {@link #response} (If this is a response to a query.) - */ - public QueryResponseComponent getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Query.response"); - else if (Configuration.doAutoCreate()) - this.response = new QueryResponseComponent(); - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (If this is a response to a query.) - */ - public Query setResponse(QueryResponseComponent value) { - this.response = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "uri", "Links query and its response(s).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("parameter", "Extension", "Set of query parameters with values.", 0, java.lang.Integer.MAX_VALUE, parameter)); - childrenList.add(new Property("response", "", "If this is a response to a query.", 0, java.lang.Integer.MAX_VALUE, response)); - } - - public Query copy() { - Query dst = new Query(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (Extension i : parameter) - dst.parameter.add(i.copy()); - }; - dst.response = response == null ? null : response.copy(); - return dst; - } - - protected Query typedCopy() { - return copy(); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (parameter == null || parameter.isEmpty()) - && (response == null || response.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Query; - } - - @SearchParamDefinition(name="response", path="Query.response.identifier", description="Links response to source query", type="token" ) - public static final String SP_RESPONSE = "response"; - @SearchParamDefinition(name="identifier", path="Query.identifier", description="Links query and its response(s)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - -} - diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java index f610a516aed..69d156bd477 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Questionnaire.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Questionnaire", profile="http://hl7.org/fhir/Profile/Questionnaire") public class Questionnaire extends DomainResource { - public enum QuestionnaireStatus { + public enum QuestionnaireStatus implements FhirEnum { /** * This Questionnaire is not ready for official use. */ @@ -62,7 +62,10 @@ public class Questionnaire extends DomainResource { * added to help the parsers */ NULL; - public static QuestionnaireStatus fromCode(String codeString) throws Exception { + + public static final QuestionnaireStatusEnumFactory ENUM_FACTORY = new QuestionnaireStatusEnumFactory(); + + public static QuestionnaireStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("draft".equals(codeString)) @@ -71,8 +74,9 @@ public class Questionnaire extends DomainResource { return PUBLISHED; if ("retired".equals(codeString)) return RETIRED; - throw new Exception("Unknown QuestionnaireStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DRAFT: return "draft"; @@ -107,8 +111,8 @@ public class Questionnaire extends DomainResource { } } - public static class QuestionnaireStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class QuestionnaireStatusEnumFactory implements EnumFactory { + public QuestionnaireStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class Questionnaire extends DomainResource { return QuestionnaireStatus.PUBLISHED; if ("retired".equals(codeString)) return QuestionnaireStatus.RETIRED; - throw new Exception("Unknown QuestionnaireStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(QuestionnaireStatus code) throws IllegalArgumentException { if (code == QuestionnaireStatus.DRAFT) return "draft"; if (code == QuestionnaireStatus.PUBLISHED) @@ -131,7 +135,7 @@ public class Questionnaire extends DomainResource { } } - public enum AnswerFormat { + public enum AnswerFormat implements FhirEnum { /** * Answer is a yes/no answer. */ @@ -192,7 +196,10 @@ public class Questionnaire extends DomainResource { * added to help the parsers */ NULL; - public static AnswerFormat fromCode(String codeString) throws Exception { + + public static final AnswerFormatEnumFactory ENUM_FACTORY = new AnswerFormatEnumFactory(); + + public static AnswerFormat fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("boolean".equals(codeString)) @@ -223,8 +230,9 @@ public class Questionnaire extends DomainResource { return REFERENCE; if ("quantity".equals(codeString)) return QUANTITY; - throw new Exception("Unknown AnswerFormat code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AnswerFormat code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case BOOLEAN: return "boolean"; @@ -303,8 +311,8 @@ public class Questionnaire extends DomainResource { } } - public static class AnswerFormatEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AnswerFormatEnumFactory implements EnumFactory { + public AnswerFormat fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -336,9 +344,9 @@ public class Questionnaire extends DomainResource { return AnswerFormat.REFERENCE; if ("quantity".equals(codeString)) return AnswerFormat.QUANTITY; - throw new Exception("Unknown AnswerFormat code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AnswerFormat code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AnswerFormat code) throws IllegalArgumentException { if (code == AnswerFormat.BOOLEAN) return "boolean"; if (code == AnswerFormat.DECIMAL) @@ -827,10 +835,10 @@ public class Questionnaire extends DomainResource { protected StringType linkId; /** - * Identifies a how this group of questions is known in a particular terminology such as LOINC. + * Identifies a how this question is known in a particular terminology such as LOINC. */ @Child(name="concept", type={Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description(shortDefinition="Concept that represents this section on a questionnaire", formalDefinition="Identifies a how this group of questions is known in a particular terminology such as LOINC." ) + @Description(shortDefinition="Concept that represents this question on a questionnaire", formalDefinition="Identifies a how this question is known in a particular terminology such as LOINC." ) protected List concept; /** @@ -936,7 +944,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) + * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) */ public List getConcept() { if (this.concept == null) @@ -954,7 +962,7 @@ public class Questionnaire extends DomainResource { } /** - * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) + * @return {@link #concept} (Identifies a how this question is known in a particular terminology such as LOINC.) */ // syntactic sugar public Coding addConcept() { //3 @@ -1057,7 +1065,7 @@ public class Questionnaire extends DomainResource { this.type = null; else { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(AnswerFormat.ENUM_FACTORY); this.type.setValue(value); } return this; @@ -1238,7 +1246,7 @@ public class Questionnaire extends DomainResource { protected void listChildren(List childrenList) { super.listChildren(childrenList); childrenList.add(new Property("linkId", "string", "An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("concept", "Coding", "Identifies a how this group of questions is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); + childrenList.add(new Property("concept", "Coding", "Identifies a how this question is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); childrenList.add(new Property("text", "string", "Text of the question as it is shown to the user.", 0, java.lang.Integer.MAX_VALUE, text)); childrenList.add(new Property("type", "code", "The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected.", 0, java.lang.Integer.MAX_VALUE, type)); childrenList.add(new Property("required", "boolean", "If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); @@ -1300,10 +1308,10 @@ public class Questionnaire extends DomainResource { protected Enumeration status; /** - * The date that this version of the questionnaire was authored. + * The date that this questionnaire was last changed. */ @Child(name="date", type={DateTimeType.class}, order=2, min=0, max=1) - @Description(shortDefinition="Date this version was authored", formalDefinition="The date that this version of the questionnaire was authored." ) + @Description(shortDefinition="Date this version was authored", formalDefinition="The date that this questionnaire was last changed." ) protected DateTimeType date; /** @@ -1451,13 +1459,13 @@ public class Questionnaire extends DomainResource { */ public Questionnaire setStatus(QuestionnaireStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(QuestionnaireStatus.ENUM_FACTORY); this.status.setValue(value); return this; } /** - * @return {@link #date} (The date that this version of the questionnaire was authored.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value */ public DateTimeType getDateElement() { if (this.date == null) @@ -1477,7 +1485,7 @@ public class Questionnaire extends DomainResource { } /** - * @param value {@link #date} (The date that this version of the questionnaire was authored.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value */ public Questionnaire setDateElement(DateTimeType value) { this.date = value; @@ -1485,16 +1493,16 @@ public class Questionnaire extends DomainResource { } /** - * @return The date that this version of the questionnaire was authored. + * @return The date that this questionnaire was last changed. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** - * @param value The date that this version of the questionnaire was authored. + * @param value The date that this questionnaire was last changed. */ - public Questionnaire setDate(DateAndTime value) { + public Questionnaire setDate(Date value) { if (value == null) this.date = null; else { @@ -1583,7 +1591,7 @@ public class Questionnaire extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("version", "string", "The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.", 0, java.lang.Integer.MAX_VALUE, version)); childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The date that this version of the questionnaire was authored.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("date", "dateTime", "The date that this questionnaire was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); childrenList.add(new Property("publisher", "string", "Organization responsible for developing and maintaining the questionnaire.", 0, java.lang.Integer.MAX_VALUE, publisher)); childrenList.add(new Property("group", "", "A collection of related questions (or further groupings of questions).", 0, java.lang.Integer.MAX_VALUE, group)); } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java index 7671f76de1c..dd49f6ec9fc 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/QuestionnaireAnswers.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="QuestionnaireAnswers", profile="http://hl7.org/fhir/Profile/QuestionnaireAnswers") public class QuestionnaireAnswers extends DomainResource { - public enum QuestionnaireAnswersStatus { + public enum QuestionnaireAnswersStatus implements FhirEnum { /** * This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it. */ @@ -62,7 +62,10 @@ public class QuestionnaireAnswers extends DomainResource { * added to help the parsers */ NULL; - public static QuestionnaireAnswersStatus fromCode(String codeString) throws Exception { + + public static final QuestionnaireAnswersStatusEnumFactory ENUM_FACTORY = new QuestionnaireAnswersStatusEnumFactory(); + + public static QuestionnaireAnswersStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("in progress".equals(codeString)) @@ -71,8 +74,9 @@ public class QuestionnaireAnswers extends DomainResource { return COMPLETED; if ("amended".equals(codeString)) return AMENDED; - throw new Exception("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case INPROGRESS: return "in progress"; @@ -107,8 +111,8 @@ public class QuestionnaireAnswers extends DomainResource { } } - public static class QuestionnaireAnswersStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class QuestionnaireAnswersStatusEnumFactory implements EnumFactory { + public QuestionnaireAnswersStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class QuestionnaireAnswers extends DomainResource { return QuestionnaireAnswersStatus.COMPLETED; if ("amended".equals(codeString)) return QuestionnaireAnswersStatus.AMENDED; - throw new Exception("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown QuestionnaireAnswersStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(QuestionnaireAnswersStatus code) throws IllegalArgumentException { if (code == QuestionnaireAnswersStatus.INPROGRESS) return "in progress"; if (code == QuestionnaireAnswersStatus.COMPLETED) @@ -1065,7 +1069,7 @@ public class QuestionnaireAnswers extends DomainResource { */ public QuestionnaireAnswers setStatus(QuestionnaireAnswersStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(QuestionnaireAnswersStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1179,14 +1183,14 @@ public class QuestionnaireAnswers extends DomainResource { /** * @return The date and/or time that this version of the questionnaire answers was authored. */ - public DateAndTime getAuthored() { + public Date getAuthored() { return this.authored == null ? null : this.authored.getValue(); } /** * @param value The date and/or time that this version of the questionnaire answers was authored. */ - public QuestionnaireAnswers setAuthored(DateAndTime value) { + public QuestionnaireAnswers setAuthored(Date value) { if (this.authored == null) this.authored = new DateTimeType(); this.authored.setValue(value); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Range.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Range.java index 13de3cd5f51..8c9c9515c89 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Range.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Range.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Ratio.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Ratio.java index 2858147518a..83f3bae6f32 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Ratio.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Ratio.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Readjudicate.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Readjudicate.java index e3cfed4c167..8f5314ce8ff 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Readjudicate.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Readjudicate.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -152,9 +152,9 @@ public class Readjudicate extends DomainResource { /** * The date when this resource was created. */ - @Child(name="date", type={DateType.class}, order=2, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who is target of the request. @@ -230,7 +230,7 @@ public class Readjudicate extends DomainResource { @Description(shortDefinition="Items to readjudicate", formalDefinition="List of top level items to be readjudicated, if none specified then the entire submission is readjudicated." ) protected List item; - private static final long serialVersionUID = 484926521L; + private static final long serialVersionUID = 445992972L; public Readjudicate() { super(); @@ -315,50 +315,50 @@ public class Readjudicate extends DomainResource { } /** - * @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Readjudicate.date"); + throw new Error("Attempt to auto-create Readjudicate.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public Readjudicate setDateElement(DateType value) { - this.date = value; + public Readjudicate setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when this resource was created. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when this resource was created. */ - public Readjudicate setDate(DateAndTime value) { + public Readjudicate setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -657,7 +657,7 @@ public class Readjudicate extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); @@ -677,7 +677,7 @@ public class Readjudicate extends DomainResource { }; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); @@ -698,7 +698,7 @@ public class Readjudicate extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (reference == null || reference.isEmpty()) && (item == null || item.isEmpty()); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reference.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reference.java index 30c7a8602a0..9d660502f32 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reference.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reference.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java index 3c160f28588..29e156e6da0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ReferralRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="ReferralRequest", profile="http://hl7.org/fhir/Profile/ReferralRequest") public class ReferralRequest extends DomainResource { - public enum Referralstatus { + public enum Referralstatus implements FhirEnum { /** * A draft referral that has yet to be send. */ @@ -74,7 +74,10 @@ public class ReferralRequest extends DomainResource { * added to help the parsers */ NULL; - public static Referralstatus fromCode(String codeString) throws Exception { + + public static final ReferralstatusEnumFactory ENUM_FACTORY = new ReferralstatusEnumFactory(); + + public static Referralstatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("draft".equals(codeString)) @@ -89,8 +92,9 @@ public class ReferralRequest extends DomainResource { return REFUSED; if ("completed".equals(codeString)) return COMPLETED; - throw new Exception("Unknown Referralstatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Referralstatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DRAFT: return "draft"; @@ -137,8 +141,8 @@ public class ReferralRequest extends DomainResource { } } - public static class ReferralstatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ReferralstatusEnumFactory implements EnumFactory { + public Referralstatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -154,9 +158,9 @@ public class ReferralRequest extends DomainResource { return Referralstatus.REFUSED; if ("completed".equals(codeString)) return Referralstatus.COMPLETED; - throw new Exception("Unknown Referralstatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Referralstatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(Referralstatus code) throws IllegalArgumentException { if (code == Referralstatus.DRAFT) return "draft"; if (code == Referralstatus.SENT) @@ -354,7 +358,7 @@ public class ReferralRequest extends DomainResource { */ public ReferralRequest setStatus(Referralstatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(Referralstatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -658,14 +662,14 @@ public class ReferralRequest extends DomainResource { /** * @return Date/DateTime the request for referral or transfer of care is sent by the author. */ - public DateAndTime getDateSent() { + public Date getDateSent() { return this.dateSent == null ? null : this.dateSent.getValue(); } /** * @param value Date/DateTime the request for referral or transfer of care is sent by the author. */ - public ReferralRequest setDateSent(DateAndTime value) { + public ReferralRequest setDateSent(Date value) { if (value == null) this.dateSent = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java index b6ffd589f6f..07aea4215f7 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RelatedPerson.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="RelatedPerson", profile="http://hl7.org/fhir/Profile/RelatedPerson") public class RelatedPerson extends DomainResource { - public enum AdministrativeGender { + public enum AdministrativeGender implements FhirEnum { /** * Male */ @@ -66,7 +66,10 @@ public class RelatedPerson extends DomainResource { * added to help the parsers */ NULL; - public static AdministrativeGender fromCode(String codeString) throws Exception { + + public static final AdministrativeGenderEnumFactory ENUM_FACTORY = new AdministrativeGenderEnumFactory(); + + public static AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("male".equals(codeString)) @@ -77,8 +80,9 @@ public class RelatedPerson extends DomainResource { return OTHER; if ("unknown".equals(codeString)) return UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case MALE: return "male"; @@ -117,8 +121,8 @@ public class RelatedPerson extends DomainResource { } } - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class AdministrativeGenderEnumFactory implements EnumFactory { + public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class RelatedPerson extends DomainResource { return AdministrativeGender.OTHER; if ("unknown".equals(codeString)) return AdministrativeGender.UNKNOWN; - throw new Exception("Unknown AdministrativeGender code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(AdministrativeGender code) throws IllegalArgumentException { if (code == AdministrativeGender.MALE) return "male"; if (code == AdministrativeGender.FEMALE) @@ -412,7 +416,7 @@ public class RelatedPerson extends DomainResource { this.gender = null; else { if (this.gender == null) - this.gender = new Enumeration(); + this.gender = new Enumeration(AdministrativeGender.ENUM_FACTORY); this.gender.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Resource.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Resource.java index 3913e00ab09..a5c639f19f0 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Resource.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Resource.java @@ -29,16 +29,16 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Fri, Dec 5, 2014 09:17+1100 for FHIR v0.3.0 import java.util.*; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; import org.hl7.fhir.instance.model.annotations.Block; import org.hl7.fhir.instance.model.annotations.Child; import org.hl7.fhir.instance.model.annotations.Description; - /** * Base Resource for everything. */ @@ -168,14 +168,14 @@ public abstract class Resource extends Base { /** * @return When the resource last changed - e.g. when the version changed. */ - public DateAndTime getLastUpdated() { + public Date getLastUpdated() { return this.lastUpdated == null ? null : this.lastUpdated.getValue(); } /** * @param value When the resource last changed - e.g. when the version changed. */ - public ResourceMetaComponent setLastUpdated(DateAndTime value) { + public ResourceMetaComponent setLastUpdated(Date value) { if (value == null) this.lastUpdated = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceFactory.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceFactory.java deleted file mode 100644 index 02c1ef577c2..00000000000 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceFactory.java +++ /dev/null @@ -1,269 +0,0 @@ -package org.hl7.fhir.instance.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 - -public class ResourceFactory extends Factory { - - public static Resource createReference(String name) throws Exception { - if ("Condition".equals(name)) - return new Condition(); - if ("Parameters".equals(name)) - return new Parameters(); - if ("Supply".equals(name)) - return new Supply(); - if ("ProcedureRequest".equals(name)) - return new ProcedureRequest(); - if ("DeviceComponent".equals(name)) - return new DeviceComponent(); - if ("Organization".equals(name)) - return new Organization(); - if ("Readjudicate".equals(name)) - return new Readjudicate(); - if ("Group".equals(name)) - return new Group(); - if ("OralHealthClaim".equals(name)) - return new OralHealthClaim(); - if ("ValueSet".equals(name)) - return new ValueSet(); - if ("Coverage".equals(name)) - return new Coverage(); - if ("ImmunizationRecommendation".equals(name)) - return new ImmunizationRecommendation(); - if ("Appointment".equals(name)) - return new Appointment(); - if ("MedicationDispense".equals(name)) - return new MedicationDispense(); - if ("MedicationPrescription".equals(name)) - return new MedicationPrescription(); - if ("Slot".equals(name)) - return new Slot(); - if ("Contraindication".equals(name)) - return new Contraindication(); - if ("PaymentNotice".equals(name)) - return new PaymentNotice(); - if ("MedicationStatement".equals(name)) - return new MedicationStatement(); - if ("AppointmentResponse".equals(name)) - return new AppointmentResponse(); - if ("Questionnaire".equals(name)) - return new Questionnaire(); - if ("Composition".equals(name)) - return new Composition(); - if ("OperationOutcome".equals(name)) - return new OperationOutcome(); - if ("Conformance".equals(name)) - return new Conformance(); - if ("NamingSystem".equals(name)) - return new NamingSystem(); - if ("Media".equals(name)) - return new Media(); - if ("Binary".equals(name)) - return new Binary(); - if ("Other".equals(name)) - return new Other(); - if ("HealthcareService".equals(name)) - return new HealthcareService(); - if ("Profile".equals(name)) - return new Profile(); - if ("DocumentReference".equals(name)) - return new DocumentReference(); - if ("Eligibility".equals(name)) - return new Eligibility(); - if ("Immunization".equals(name)) - return new Immunization(); - if ("Bundle".equals(name)) - return new Bundle(); - if ("ExtensionDefinition".equals(name)) - return new ExtensionDefinition(); - if ("Subscription".equals(name)) - return new Subscription(); - if ("OrderResponse".equals(name)) - return new OrderResponse(); - if ("StatusResponse".equals(name)) - return new StatusResponse(); - if ("ConceptMap".equals(name)) - return new ConceptMap(); - if ("Reversal".equals(name)) - return new Reversal(); - if ("ImagingStudy".equals(name)) - return new ImagingStudy(); - if ("Practitioner".equals(name)) - return new Practitioner(); - if ("CarePlan".equals(name)) - return new CarePlan(); - if ("Provenance".equals(name)) - return new Provenance(); - if ("Device".equals(name)) - return new Device(); - if ("Query".equals(name)) - return new Query(); - if ("Order".equals(name)) - return new Order(); - if ("Procedure".equals(name)) - return new Procedure(); - if ("Substance".equals(name)) - return new Substance(); - if ("DeviceUseRequest".equals(name)) - return new DeviceUseRequest(); - if ("DiagnosticReport".equals(name)) - return new DiagnosticReport(); - if ("Medication".equals(name)) - return new Medication(); - if ("MessageHeader".equals(name)) - return new MessageHeader(); - if ("DataElement".equals(name)) - return new DataElement(); - if ("DocumentManifest".equals(name)) - return new DocumentManifest(); - if ("Availability".equals(name)) - return new Availability(); - if ("MedicationAdministration".equals(name)) - return new MedicationAdministration(); - if ("QuestionnaireAnswers".equals(name)) - return new QuestionnaireAnswers(); - if ("Encounter".equals(name)) - return new Encounter(); - if ("Enrollment".equals(name)) - return new Enrollment(); - if ("SecurityEvent".equals(name)) - return new SecurityEvent(); - if ("PaymentReconciliation".equals(name)) - return new PaymentReconciliation(); - if ("PendedRequest".equals(name)) - return new PendedRequest(); - if ("List".equals(name)) - return new List_(); - if ("DeviceUseStatement".equals(name)) - return new DeviceUseStatement(); - if ("ImagingObjectSelection".equals(name)) - return new ImagingObjectSelection(); - if ("OperationDefinition".equals(name)) - return new OperationDefinition(); - if ("NutritionOrder".equals(name)) - return new NutritionOrder(); - if ("SearchParameter".equals(name)) - return new SearchParameter(); - if ("ClaimResponse".equals(name)) - return new ClaimResponse(); - if ("ReferralRequest".equals(name)) - return new ReferralRequest(); - if ("CommunicationRequest".equals(name)) - return new CommunicationRequest(); - if ("RiskAssessment".equals(name)) - return new RiskAssessment(); - if ("FamilyHistory".equals(name)) - return new FamilyHistory(); - if ("Location".equals(name)) - return new Location(); - if ("Observation".equals(name)) - return new Observation(); - if ("AllergyIntolerance".equals(name)) - return new AllergyIntolerance(); - if ("ExplanationOfBenefit".equals(name)) - return new ExplanationOfBenefit(); - if ("Contract".equals(name)) - return new Contract(); - if ("SupportingDocumentation".equals(name)) - return new SupportingDocumentation(); - if ("RelatedPerson".equals(name)) - return new RelatedPerson(); - if ("Basic".equals(name)) - return new Basic(); - if ("Specimen".equals(name)) - return new Specimen(); - if ("Alert".equals(name)) - return new Alert(); - if ("EnrollmentResponse".equals(name)) - return new EnrollmentResponse(); - if ("Patient".equals(name)) - return new Patient(); - if ("EligibilityResponse".equals(name)) - return new EligibilityResponse(); - if ("StatusRequest".equals(name)) - return new StatusRequest(); - if ("DiagnosticOrder".equals(name)) - return new DiagnosticOrder(); - else - throw new Exception("Unknown Resource Name '"+name+"'"); - } - - public static Element createType(String name) throws Exception { - if ("Timing".equals(name)) - return new Timing(); - if ("Period".equals(name)) - return new Period(); - if ("Coding".equals(name)) - return new Coding(); - if ("Range".equals(name)) - return new Range(); - if ("Age".equals(name)) - return new Age(); - if ("Count".equals(name)) - return new Count(); - if ("Quantity".equals(name)) - return new Quantity(); - if ("Attachment".equals(name)) - return new Attachment(); - if ("Money".equals(name)) - return new Money(); - if ("Distance".equals(name)) - return new Distance(); - if ("ContactPoint".equals(name)) - return new ContactPoint(); - if ("ElementDefinition".equals(name)) - return new ElementDefinition(); - if ("Extension".equals(name)) - return new Extension(); - if ("HumanName".equals(name)) - return new HumanName(); - if ("Address".equals(name)) - return new Address(); - if ("Duration".equals(name)) - return new Duration(); - if ("Ratio".equals(name)) - return new Ratio(); - if ("SampledData".equals(name)) - return new SampledData(); - if ("Reference".equals(name)) - return new Reference(); - if ("CodeableConcept".equals(name)) - return new CodeableConcept(); - if ("Identifier".equals(name)) - return new Identifier(); - if ("Narrative".equals(name)) - return new Narrative(); - else - throw new Exception("Unknown Type Name '"+name+"'"); - } - -} - diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceReference.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceReference.java new file mode 100644 index 00000000000..38fd1ba3496 --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceReference.java @@ -0,0 +1,146 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011-2013, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Feb 16, 2014 16:44-0500 for FHIR v0.80 + +import java.util.List; + +/** + * A reference from one resource to another. + */ +public class ResourceReference extends Type { + + /** + * A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + */ + protected StringType reference; + + /** + * Plain text narrative that identifies the resource in addition to the resource reference. + */ + protected StringType display; + + public ResourceReference() { + super(); + } + + /** + * @return {@link #reference} (A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.) + */ + public StringType getReference() { + return this.reference; + } + + /** + * @param value {@link #reference} (A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.) + */ + public ResourceReference setReference(StringType value) { + this.reference = value; + return this; + } + + /** + * @return A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + */ + public String getReferenceSimple() { + return this.reference == null ? null : this.reference.getValue(); + } + + /** + * @param value A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + */ + public ResourceReference setReferenceSimple(String value) { + if (value == null) + this.reference = null; + else { + if (this.reference == null) + this.reference = new StringType(); + this.reference.setValue(value); + } + return this; + } + + /** + * @return {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.) + */ + public StringType getDisplay() { + return this.display; + } + + /** + * @param value {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.) + */ + public ResourceReference setDisplay(StringType value) { + this.display = value; + return this; + } + + /** + * @return Plain text narrative that identifies the resource in addition to the resource reference. + */ + public String getDisplaySimple() { + return this.display == null ? null : this.display.getValue(); + } + + /** + * @param value Plain text narrative that identifies the resource in addition to the resource reference. + */ + public ResourceReference setDisplaySimple(String value) { + if (value == null) + this.display = null; + else { + if (this.display == null) + this.display = new StringType(); + this.display.setValue(value); + } + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("reference", "string", "A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.", 0, java.lang.Integer.MAX_VALUE, reference)); + childrenList.add(new Property("display", "string", "Plain text narrative that identifies the resource in addition to the resource reference.", 0, java.lang.Integer.MAX_VALUE, display)); + } + + public ResourceReference copy() { + ResourceReference dst = new ResourceReference(); + dst.reference = reference == null ? null : reference.copy(); + dst.display = display == null ? null : display.copy(); + return dst; + } + + protected ResourceReference typedCopy() { + return copy(); + } + + +} + diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceType.java index a47d08bdc4d..5cc3a028013 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ResourceType.java @@ -1,95 +1,106 @@ package org.hl7.fhir.instance.model; -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 public enum ResourceType { Condition, Supply, - ProcedureRequest, DeviceComponent, - Organization, - Readjudicate, + Communication, Group, - OralHealthClaim, ValueSet, + OralHealthClaim, Coverage, - ImmunizationRecommendation, Appointment, - MedicationDispense, - MedicationPrescription, Slot, - PaymentNotice, Contraindication, - AppointmentResponse, - MedicationStatement, Composition, - Questionnaire, - OperationOutcome, Conformance, NamingSystem, - Media, - Binary, - Other, - HealthcareService, Profile, - DocumentReference, - Eligibility, - Immunization, - Bundle, - ExtensionDefinition, - Subscription, + HealthcareService, OrderResponse, StatusResponse, ConceptMap, + PharmacyClaim, Reversal, - ImagingStudy, Practitioner, CarePlan, - Provenance, - Device, - Query, - Order, - Procedure, + ClinicalAssessment, Substance, DeviceUseRequest, + EligibilityRequest, + QuestionnaireAnswers, + PaymentReconciliation, + ProfessionalClaim, + ImagingObjectSelection, + OperationDefinition, + ClaimResponse, + CommunicationRequest, + RiskAssessment, + Observation, + AllergyIntolerance, + ExplanationOfBenefit, + GoalRequest, + SupportingDocumentation, + RelatedPerson, + InstitutionalClaim, + Alert, + EligibilityResponse, + Person, + StatusRequest, + ProcedureRequest, + VisionClaim, + DeviceMetric, + Organization, + Readjudicate, + ImmunizationRecommendation, + MedicationDispense, + MedicationPrescription, + PaymentNotice, + MedicationStatement, + AppointmentResponse, + Questionnaire, + OperationOutcome, + Media, + Binary, + Other, + DocumentReference, + Immunization, + ExtensionDefinition, + Bundle, + Subscription, + ImagingStudy, + Provenance, + Device, + Order, + Procedure, DiagnosticReport, Medication, MessageHeader, DocumentManifest, DataElement, Availability, - QuestionnaireAnswers, MedicationAdministration, Encounter, - Enrollment, - PaymentReconciliation, SecurityEvent, PendedRequest, List, DeviceUseStatement, - OperationDefinition, - ImagingObjectSelection, - SearchParameter, + Goal, NutritionOrder, - ClaimResponse, + SearchParameter, ReferralRequest, - CommunicationRequest, - RiskAssessment, FamilyHistory, + EnrollmentRequest, Location, - ExplanationOfBenefit, - AllergyIntolerance, - Observation, Contract, - SupportingDocumentation, - RelatedPerson, Basic, Specimen, - Alert, EnrollmentResponse, Patient, - EligibilityResponse, - StatusRequest, + CareActivity, + CarePlan2, DiagnosticOrder, Parameters; @@ -100,100 +111,146 @@ public enum ResourceType { return "condition"; case Supply: return "supply"; - case ProcedureRequest: - return "procedurerequest"; case DeviceComponent: return "devicecomponent"; - case Organization: - return "organization"; - case Readjudicate: - return "readjudicate"; + case Communication: + return "communication"; case Group: return "group"; - case OralHealthClaim: - return "oralhealthclaim"; case ValueSet: return "valueset"; + case OralHealthClaim: + return "oralhealthclaim"; case Coverage: return "coverage"; - case ImmunizationRecommendation: - return "immunizationrecommendation"; case Appointment: return "appointment"; - case MedicationDispense: - return "medicationdispense"; - case MedicationPrescription: - return "medicationprescription"; case Slot: return "slot"; - case PaymentNotice: - return "paymentnotice"; case Contraindication: return "contraindication"; - case AppointmentResponse: - return "appointmentresponse"; - case MedicationStatement: - return "medicationstatement"; case Composition: return "composition"; - case Questionnaire: - return "questionnaire"; - case OperationOutcome: - return "operationoutcome"; case Conformance: return "conformance"; case NamingSystem: return "namingsystem"; - case Media: - return "media"; - case Binary: - return "binary"; - case Other: - return "other"; - case HealthcareService: - return "healthcareservice"; case Profile: return "profile"; - case DocumentReference: - return "documentreference"; - case Eligibility: - return "eligibility"; - case Immunization: - return "immunization"; - case Bundle: - return "bundle"; - case ExtensionDefinition: - return "extensiondefinition"; - case Subscription: - return "subscription"; + case HealthcareService: + return "healthcareservice"; case OrderResponse: return "orderresponse"; case StatusResponse: return "statusresponse"; case ConceptMap: return "conceptmap"; + case PharmacyClaim: + return "pharmacyclaim"; case Reversal: return "reversal"; - case ImagingStudy: - return "imagingstudy"; case Practitioner: return "practitioner"; case CarePlan: return "careplan"; - case Provenance: - return "provenance"; - case Device: - return "device"; - case Query: - return "query"; - case Order: - return "order"; - case Procedure: - return "procedure"; + case ClinicalAssessment: + return "clinicalassessment"; case Substance: return "substance"; case DeviceUseRequest: return "deviceuserequest"; + case EligibilityRequest: + return "eligibilityrequest"; + case QuestionnaireAnswers: + return "questionnaireanswers"; + case PaymentReconciliation: + return "paymentreconciliation"; + case ProfessionalClaim: + return "professionalclaim"; + case ImagingObjectSelection: + return "imagingobjectselection"; + case OperationDefinition: + return "operationdefinition"; + case ClaimResponse: + return "claimresponse"; + case CommunicationRequest: + return "communicationrequest"; + case RiskAssessment: + return "riskassessment"; + case Observation: + return "observation"; + case AllergyIntolerance: + return "allergyintolerance"; + case ExplanationOfBenefit: + return "explanationofbenefit"; + case GoalRequest: + return "goalrequest"; + case SupportingDocumentation: + return "supportingdocumentation"; + case RelatedPerson: + return "relatedperson"; + case InstitutionalClaim: + return "institutionalclaim"; + case Alert: + return "alert"; + case EligibilityResponse: + return "eligibilityresponse"; + case Person: + return "person"; + case StatusRequest: + return "statusrequest"; + case ProcedureRequest: + return "procedurerequest"; + case VisionClaim: + return "visionclaim"; + case DeviceMetric: + return "devicemetric"; + case Organization: + return "organization"; + case Readjudicate: + return "readjudicate"; + case ImmunizationRecommendation: + return "immunizationrecommendation"; + case MedicationDispense: + return "medicationdispense"; + case MedicationPrescription: + return "medicationprescription"; + case PaymentNotice: + return "paymentnotice"; + case MedicationStatement: + return "medicationstatement"; + case AppointmentResponse: + return "appointmentresponse"; + case Questionnaire: + return "questionnaire"; + case OperationOutcome: + return "operationoutcome"; + case Media: + return "media"; + case Binary: + return "binary"; + case Other: + return "other"; + case DocumentReference: + return "documentreference"; + case Immunization: + return "immunization"; + case ExtensionDefinition: + return "extensiondefinition"; + case Bundle: + return "bundle"; + case Subscription: + return "subscription"; + case ImagingStudy: + return "imagingstudy"; + case Provenance: + return "provenance"; + case Device: + return "device"; + case Order: + return "order"; + case Procedure: + return "procedure"; case DiagnosticReport: return "diagnosticreport"; case Medication: @@ -206,16 +263,10 @@ public enum ResourceType { return "dataelement"; case Availability: return "availability"; - case QuestionnaireAnswers: - return "questionnaireanswers"; case MedicationAdministration: return "medicationadministration"; case Encounter: return "encounter"; - case Enrollment: - return "enrollment"; - case PaymentReconciliation: - return "paymentreconciliation"; case SecurityEvent: return "securityevent"; case PendedRequest: @@ -224,52 +275,34 @@ public enum ResourceType { return "list"; case DeviceUseStatement: return "deviceusestatement"; - case OperationDefinition: - return "operationdefinition"; - case ImagingObjectSelection: - return "imagingobjectselection"; - case SearchParameter: - return "searchparameter"; + case Goal: + return "goal"; case NutritionOrder: return "nutritionorder"; - case ClaimResponse: - return "claimresponse"; + case SearchParameter: + return "searchparameter"; case ReferralRequest: return "referralrequest"; - case CommunicationRequest: - return "communicationrequest"; - case RiskAssessment: - return "riskassessment"; case FamilyHistory: return "familyhistory"; + case EnrollmentRequest: + return "enrollmentrequest"; case Location: return "location"; - case ExplanationOfBenefit: - return "explanationofbenefit"; - case AllergyIntolerance: - return "allergyintolerance"; - case Observation: - return "observation"; case Contract: return "contract"; - case SupportingDocumentation: - return "supportingdocumentation"; - case RelatedPerson: - return "relatedperson"; case Basic: return "basic"; case Specimen: return "specimen"; - case Alert: - return "alert"; case EnrollmentResponse: return "enrollmentresponse"; case Patient: return "patient"; - case EligibilityResponse: - return "eligibilityresponse"; - case StatusRequest: - return "statusrequest"; + case CareActivity: + return "careactivity"; + case CarePlan2: + return "careplan2"; case DiagnosticOrder: return "diagnosticorder"; case Parameters: diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reversal.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reversal.java index 4be87fd7c94..abe5cb0ac7e 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reversal.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Reversal.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -593,9 +593,9 @@ public class Reversal extends DomainResource { /** * The date when this resource was created. */ - @Child(name="date", type={DateType.class}, order=2, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who is target of the request. @@ -678,7 +678,7 @@ public class Reversal extends DomainResource { @Description(shortDefinition="Nullify", formalDefinition="If true remove all history excluding audit." ) protected BooleanType nullify; - private static final long serialVersionUID = -868678848L; + private static final long serialVersionUID = 1077326413L; public Reversal() { super(); @@ -769,50 +769,50 @@ public class Reversal extends DomainResource { } /** - * @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reversal.date"); + throw new Error("Attempt to auto-create Reversal.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public Reversal setDateElement(DateType value) { - this.date = value; + public Reversal setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when this resource was created. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when this resource was created. */ - public Reversal setDate(DateAndTime value) { + public Reversal setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -1125,7 +1125,7 @@ public class Reversal extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); @@ -1146,7 +1146,7 @@ public class Reversal extends DomainResource { }; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); @@ -1164,7 +1164,7 @@ public class Reversal extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (payee == null || payee.isEmpty()) && (coverage == null || coverage.isEmpty()) && (nullify == null || nullify.isEmpty()); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java index e0f02c0f91a..022b7dee169 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/RiskAssessment.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -486,14 +486,14 @@ public class RiskAssessment extends DomainResource { /** * @return The date (and possibly time) the risk assessment was performed. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date (and possibly time) the risk assessment was performed. */ - public RiskAssessment setDate(DateAndTime value) { + public RiskAssessment setDate(Date value) { if (value == null) this.date = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SampledData.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SampledData.java index ce936096840..f3cd58f5090 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SampledData.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SampledData.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Schedule.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Schedule.java deleted file mode 100644 index 1ba953e567f..00000000000 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Schedule.java +++ /dev/null @@ -1,573 +0,0 @@ -package org.hl7.fhir.instance.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, Sep 28, 2014 20:18+1000 for FHIR v0.3.0 - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -/** - * Specifies an event that may occur multiple times. Schedules are used for to reord when things are expected or requested to occur. - */ -public class Schedule extends Type { - - public enum EventTiming { - hS, // event occurs [duration] before the hour of sleep (or trying to). - wAKE, // event occurs [duration] after waking. - aC, // event occurs [duration] before a meal (from the Latin ante cibus). - aCM, // event occurs [duration] before breakfast (from the Latin ante cibus matutinus). - aCD, // event occurs [duration] before lunch (from the Latin ante cibus diurnus). - aCV, // event occurs [duration] before dinner (from the Latin ante cibus vespertinus). - pC, // event occurs [duration] after a meal (from the Latin post cibus). - pCM, // event occurs [duration] after breakfast (from the Latin post cibus matutinus). - pCD, // event occurs [duration] after lunch (from the Latin post cibus diurnus). - pCV, // event occurs [duration] after dinner (from the Latin post cibus vespertinus). - Null; // added to help the parsers - public static EventTiming fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("HS".equals(codeString)) - return hS; - if ("WAKE".equals(codeString)) - return wAKE; - if ("AC".equals(codeString)) - return aC; - if ("ACM".equals(codeString)) - return aCM; - if ("ACD".equals(codeString)) - return aCD; - if ("ACV".equals(codeString)) - return aCV; - if ("PC".equals(codeString)) - return pC; - if ("PCM".equals(codeString)) - return pCM; - if ("PCD".equals(codeString)) - return pCD; - if ("PCV".equals(codeString)) - return pCV; - throw new Exception("Unknown EventTiming code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case hS: return "HS"; - case wAKE: return "WAKE"; - case aC: return "AC"; - case aCM: return "ACM"; - case aCD: return "ACD"; - case aCV: return "ACV"; - case pC: return "PC"; - case pCM: return "PCM"; - case pCD: return "PCD"; - case pCV: return "PCV"; - default: return "?"; - } - } - } - - public static class EventTimingEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("HS".equals(codeString)) - return EventTiming.hS; - if ("WAKE".equals(codeString)) - return EventTiming.wAKE; - if ("AC".equals(codeString)) - return EventTiming.aC; - if ("ACM".equals(codeString)) - return EventTiming.aCM; - if ("ACD".equals(codeString)) - return EventTiming.aCD; - if ("ACV".equals(codeString)) - return EventTiming.aCV; - if ("PC".equals(codeString)) - return EventTiming.pC; - if ("PCM".equals(codeString)) - return EventTiming.pCM; - if ("PCD".equals(codeString)) - return EventTiming.pCD; - if ("PCV".equals(codeString)) - return EventTiming.pCV; - throw new Exception("Unknown EventTiming code '"+codeString+"'"); - } - public String toCode(Enum code) throws Exception { - if (code == EventTiming.hS) - return "HS"; - if (code == EventTiming.wAKE) - return "WAKE"; - if (code == EventTiming.aC) - return "AC"; - if (code == EventTiming.aCM) - return "ACM"; - if (code == EventTiming.aCD) - return "ACD"; - if (code == EventTiming.aCV) - return "ACV"; - if (code == EventTiming.pC) - return "PC"; - if (code == EventTiming.pCM) - return "PCM"; - if (code == EventTiming.pCD) - return "PCD"; - if (code == EventTiming.pCV) - return "PCV"; - return "?"; - } - } - - public enum UnitsOfTime { - s, // second. - min, // minute. - h, // hour. - d, // day. - wk, // week. - mo, // month. - a, // year. - Null; // added to help the parsers - public static UnitsOfTime fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - return null; - if ("s".equals(codeString)) - return s; - if ("min".equals(codeString)) - return min; - if ("h".equals(codeString)) - return h; - if ("d".equals(codeString)) - return d; - if ("wk".equals(codeString)) - return wk; - if ("mo".equals(codeString)) - return mo; - if ("a".equals(codeString)) - return a; - throw new Exception("Unknown UnitsOfTime code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case s: return "s"; - case min: return "min"; - case h: return "h"; - case d: return "d"; - case wk: return "wk"; - case mo: return "mo"; - case a: return "a"; - default: return "?"; - } - } - } - - public static class UnitsOfTimeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("s".equals(codeString)) - return UnitsOfTime.s; - if ("min".equals(codeString)) - return UnitsOfTime.min; - if ("h".equals(codeString)) - return UnitsOfTime.h; - if ("d".equals(codeString)) - return UnitsOfTime.d; - if ("wk".equals(codeString)) - return UnitsOfTime.wk; - if ("mo".equals(codeString)) - return UnitsOfTime.mo; - if ("a".equals(codeString)) - return UnitsOfTime.a; - throw new Exception("Unknown UnitsOfTime code '"+codeString+"'"); - } - public String toCode(Enum code) throws Exception { - if (code == UnitsOfTime.s) - return "s"; - if (code == UnitsOfTime.min) - return "min"; - if (code == UnitsOfTime.h) - return "h"; - if (code == UnitsOfTime.d) - return "d"; - if (code == UnitsOfTime.wk) - return "wk"; - if (code == UnitsOfTime.mo) - return "mo"; - if (code == UnitsOfTime.a) - return "a"; - return "?"; - } - } - - public static class ScheduleRepeatComponent extends Element { - /** - * Indicates how often the event should occur. - */ - protected IntegerType frequency; - - /** - * Identifies the occurrence of daily life that determines timing. - */ - protected Enumeration when; - - /** - * How long each repetition should last. - */ - protected DecimalType duration; - - /** - * The units of time for the duration. - */ - protected Enumeration units; - - /** - * A total count of the desired number of repetitions. - */ - protected IntegerType count; - - /** - * When to stop repeating the schedule. - */ - protected DateTimeType end; - - private static final long serialVersionUID = -615844988L; - - public ScheduleRepeatComponent() { - super(); - } - - public ScheduleRepeatComponent(DecimalType duration, Enumeration units) { - super(); - this.duration = duration; - this.units = units; - } - - /** - * @return {@link #frequency} (Indicates how often the event should occur.) - */ - public IntegerType getFrequency() { - return this.frequency; - } - - /** - * @param value {@link #frequency} (Indicates how often the event should occur.) - */ - public ScheduleRepeatComponent setFrequency(IntegerType value) { - this.frequency = value; - return this; - } - - /** - * @return Indicates how often the event should occur. - */ - public int getFrequencySimple() { - return this.frequency == null ? null : this.frequency.getValue(); - } - - /** - * @param value Indicates how often the event should occur. - */ - public ScheduleRepeatComponent setFrequencySimple(int value) { - if (value == -1) - this.frequency = null; - else { - if (this.frequency == null) - this.frequency = new IntegerType(); - this.frequency.setValue(value); - } - return this; - } - - /** - * @return {@link #when} (Identifies the occurrence of daily life that determines timing.) - */ - public Enumeration getWhen() { - return this.when; - } - - /** - * @param value {@link #when} (Identifies the occurrence of daily life that determines timing.) - */ - public ScheduleRepeatComponent setWhen(Enumeration value) { - this.when = value; - return this; - } - - /** - * @return Identifies the occurrence of daily life that determines timing. - */ - public EventTiming getWhenSimple() { - return this.when == null ? null : this.when.getValue(); - } - - /** - * @param value Identifies the occurrence of daily life that determines timing. - */ - public ScheduleRepeatComponent setWhenSimple(EventTiming value) { - if (value == null) - this.when = null; - else { - if (this.when == null) - this.when = new Enumeration(); - this.when.setValue(value); - } - return this; - } - - /** - * @return {@link #duration} (How long each repetition should last.) - */ - public DecimalType getDuration() { - return this.duration; - } - - /** - * @param value {@link #duration} (How long each repetition should last.) - */ - public ScheduleRepeatComponent setDuration(DecimalType value) { - this.duration = value; - return this; - } - - /** - * @return How long each repetition should last. - */ - public BigDecimal getDurationSimple() { - return this.duration == null ? null : this.duration.getValue(); - } - - /** - * @param value How long each repetition should last. - */ - public ScheduleRepeatComponent setDurationSimple(BigDecimal value) { - if (this.duration == null) - this.duration = new DecimalType(); - this.duration.setValue(value); - return this; - } - - /** - * @return {@link #units} (The units of time for the duration.) - */ - public Enumeration getUnits() { - return this.units; - } - - /** - * @param value {@link #units} (The units of time for the duration.) - */ - public ScheduleRepeatComponent setUnits(Enumeration value) { - this.units = value; - return this; - } - - /** - * @return The units of time for the duration. - */ - public UnitsOfTime getUnitsSimple() { - return this.units == null ? null : this.units.getValue(); - } - - /** - * @param value The units of time for the duration. - */ - public ScheduleRepeatComponent setUnitsSimple(UnitsOfTime value) { - if (this.units == null) - this.units = new Enumeration(); - this.units.setValue(value); - return this; - } - - /** - * @return {@link #count} (A total count of the desired number of repetitions.) - */ - public IntegerType getCount() { - return this.count; - } - - /** - * @param value {@link #count} (A total count of the desired number of repetitions.) - */ - public ScheduleRepeatComponent setCount(IntegerType value) { - this.count = value; - return this; - } - - /** - * @return A total count of the desired number of repetitions. - */ - public int getCountSimple() { - return this.count == null ? null : this.count.getValue(); - } - - /** - * @param value A total count of the desired number of repetitions. - */ - public ScheduleRepeatComponent setCountSimple(int value) { - if (value == -1) - this.count = null; - else { - if (this.count == null) - this.count = new IntegerType(); - this.count.setValue(value); - } - return this; - } - - /** - * @return {@link #end} (When to stop repeating the schedule.) - */ - public DateTimeType getEnd() { - return this.end; - } - - /** - * @param value {@link #end} (When to stop repeating the schedule.) - */ - public ScheduleRepeatComponent setEnd(DateTimeType value) { - this.end = value; - return this; - } - - /** - * @return When to stop repeating the schedule. - */ - public DateAndTime getEndSimple() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value When to stop repeating the schedule. - */ - public ScheduleRepeatComponent setEndSimple(DateAndTime value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new DateTimeType(); - this.end.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("frequency", "integer", "Indicates how often the event should occur.", 0, java.lang.Integer.MAX_VALUE, frequency)); - childrenList.add(new Property("when", "code", "Identifies the occurrence of daily life that determines timing.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("duration", "decimal", "How long each repetition should last.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("units", "code", "The units of time for the duration.", 0, java.lang.Integer.MAX_VALUE, units)); - childrenList.add(new Property("count", "integer", "A total count of the desired number of repetitions.", 0, java.lang.Integer.MAX_VALUE, count)); - childrenList.add(new Property("end", "dateTime", "When to stop repeating the schedule.", 0, java.lang.Integer.MAX_VALUE, end)); - } - - public ScheduleRepeatComponent copy() { - ScheduleRepeatComponent dst = new ScheduleRepeatComponent(); - dst.frequency = frequency == null ? null : frequency.copy(); - dst.when = when == null ? null : when.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.units = units == null ? null : units.copy(); - dst.count = count == null ? null : count.copy(); - dst.end = end == null ? null : end.copy(); - return dst; - } - - } - - /** - * Identifies specific time periods when the event should occur. - */ - protected List event = new ArrayList(); - - /** - * Identifies a repeating pattern to the intended time periods. - */ - protected ScheduleRepeatComponent repeat; - - private static final long serialVersionUID = -537139777L; - - public Schedule() { - super(); - } - - /** - * @return {@link #event} (Identifies specific time periods when the event should occur.) - */ - public List getEvent() { - return this.event; - } - - // syntactic sugar - /** - * @return {@link #event} (Identifies specific time periods when the event should occur.) - */ - public Period addEvent() { - Period t = new Period(); - this.event.add(t); - return t; - } - - /** - * @return {@link #repeat} (Identifies a repeating pattern to the intended time periods.) - */ - public ScheduleRepeatComponent getRepeat() { - return this.repeat; - } - - /** - * @param value {@link #repeat} (Identifies a repeating pattern to the intended time periods.) - */ - public Schedule setRepeat(ScheduleRepeatComponent value) { - this.repeat = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("event", "Period", "Identifies specific time periods when the event should occur.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("repeat", "", "Identifies a repeating pattern to the intended time periods.", 0, java.lang.Integer.MAX_VALUE, repeat)); - } - - public Schedule copy() { - Schedule dst = new Schedule(); - dst.event = new ArrayList(); - for (Period i : event) - dst.event.add(i.copy()); - dst.repeat = repeat == null ? null : repeat.copy(); - return dst; - } - - protected Schedule typedCopy() { - return copy(); - } - - -} - diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java index e88755f2d33..8dcb070a46f 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SearchParameter.java @@ -29,13 +29,14 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.instance.model.annotations.ResourceDef; import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; import org.hl7.fhir.instance.model.annotations.Child; import org.hl7.fhir.instance.model.annotations.Description; /** @@ -44,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="SearchParameter", profile="http://hl7.org/fhir/Profile/SearchParameter") public class SearchParameter extends DomainResource { - public enum SearchParamType { + public enum SearchParamType implements FhirEnum { /** * Search parameter SHALL be a number (a whole number, or a decimal). */ @@ -77,7 +78,10 @@ public class SearchParameter extends DomainResource { * added to help the parsers */ NULL; - public static SearchParamType fromCode(String codeString) throws Exception { + + public static final SearchParamTypeEnumFactory ENUM_FACTORY = new SearchParamTypeEnumFactory(); + + public static SearchParamType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("number".equals(codeString)) @@ -94,8 +98,9 @@ public class SearchParameter extends DomainResource { return COMPOSITE; if ("quantity".equals(codeString)) return QUANTITY; - throw new Exception("Unknown SearchParamType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case NUMBER: return "number"; @@ -146,8 +151,8 @@ public class SearchParameter extends DomainResource { } } - public static class SearchParamTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class SearchParamTypeEnumFactory implements EnumFactory { + public SearchParamType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -165,9 +170,9 @@ public class SearchParameter extends DomainResource { return SearchParamType.COMPOSITE; if ("quantity".equals(codeString)) return SearchParamType.QUANTITY; - throw new Exception("Unknown SearchParamType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(SearchParamType code) throws IllegalArgumentException { if (code == SearchParamType.NUMBER) return "number"; if (code == SearchParamType.DATE) @@ -574,7 +579,7 @@ public class SearchParameter extends DomainResource { */ public SearchParameter setType(SearchParamType value) { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(SearchParamType.ENUM_FACTORY); this.type.setValue(value); return this; } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SecurityEvent.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SecurityEvent.java index c05dcd37e84..bba0f206f8d 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SecurityEvent.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SecurityEvent.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="SecurityEvent", profile="http://hl7.org/fhir/Profile/SecurityEvent") public class SecurityEvent extends DomainResource { - public enum SecurityEventAction { + public enum SecurityEventAction implements FhirEnum { /** * Create a new database object, such as Placing an Order. */ @@ -70,7 +70,10 @@ public class SecurityEvent extends DomainResource { * added to help the parsers */ NULL; - public static SecurityEventAction fromCode(String codeString) throws Exception { + + public static final SecurityEventActionEnumFactory ENUM_FACTORY = new SecurityEventActionEnumFactory(); + + public static SecurityEventAction fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("C".equals(codeString)) @@ -83,8 +86,9 @@ public class SecurityEvent extends DomainResource { return D; if ("E".equals(codeString)) return E; - throw new Exception("Unknown SecurityEventAction code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SecurityEventAction code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case C: return "C"; @@ -127,8 +131,8 @@ public class SecurityEvent extends DomainResource { } } - public static class SecurityEventActionEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class SecurityEventActionEnumFactory implements EnumFactory { + public SecurityEventAction fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -142,9 +146,9 @@ public class SecurityEvent extends DomainResource { return SecurityEventAction.D; if ("E".equals(codeString)) return SecurityEventAction.E; - throw new Exception("Unknown SecurityEventAction code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SecurityEventAction code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(SecurityEventAction code) throws IllegalArgumentException { if (code == SecurityEventAction.C) return "C"; if (code == SecurityEventAction.R) @@ -159,7 +163,7 @@ public class SecurityEvent extends DomainResource { } } - public enum SecurityEventOutcome { + public enum SecurityEventOutcome implements FhirEnum { /** * The operation completed successfully (whether with warnings or not). */ @@ -180,7 +184,10 @@ public class SecurityEvent extends DomainResource { * added to help the parsers */ NULL; - public static SecurityEventOutcome fromCode(String codeString) throws Exception { + + public static final SecurityEventOutcomeEnumFactory ENUM_FACTORY = new SecurityEventOutcomeEnumFactory(); + + public static SecurityEventOutcome fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("0".equals(codeString)) @@ -191,8 +198,9 @@ public class SecurityEvent extends DomainResource { return _8; if ("12".equals(codeString)) return _12; - throw new Exception("Unknown SecurityEventOutcome code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SecurityEventOutcome code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case _0: return "0"; @@ -231,8 +239,8 @@ public class SecurityEvent extends DomainResource { } } - public static class SecurityEventOutcomeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class SecurityEventOutcomeEnumFactory implements EnumFactory { + public SecurityEventOutcome fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -244,9 +252,9 @@ public class SecurityEvent extends DomainResource { return SecurityEventOutcome._8; if ("12".equals(codeString)) return SecurityEventOutcome._12; - throw new Exception("Unknown SecurityEventOutcome code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SecurityEventOutcome code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(SecurityEventOutcome code) throws IllegalArgumentException { if (code == SecurityEventOutcome._0) return "0"; if (code == SecurityEventOutcome._4) @@ -259,7 +267,7 @@ public class SecurityEvent extends DomainResource { } } - public enum NetworkType { + public enum NetworkType implements FhirEnum { /** * Machine Name, including DNS name. */ @@ -284,7 +292,10 @@ public class SecurityEvent extends DomainResource { * added to help the parsers */ NULL; - public static NetworkType fromCode(String codeString) throws Exception { + + public static final NetworkTypeEnumFactory ENUM_FACTORY = new NetworkTypeEnumFactory(); + + public static NetworkType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("1".equals(codeString)) @@ -297,8 +308,9 @@ public class SecurityEvent extends DomainResource { return _4; if ("5".equals(codeString)) return _5; - throw new Exception("Unknown NetworkType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NetworkType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case _1: return "1"; @@ -341,8 +353,8 @@ public class SecurityEvent extends DomainResource { } } - public static class NetworkTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class NetworkTypeEnumFactory implements EnumFactory { + public NetworkType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -356,9 +368,9 @@ public class SecurityEvent extends DomainResource { return NetworkType._4; if ("5".equals(codeString)) return NetworkType._5; - throw new Exception("Unknown NetworkType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown NetworkType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(NetworkType code) throws IllegalArgumentException { if (code == NetworkType._1) return "1"; if (code == NetworkType._2) @@ -373,7 +385,7 @@ public class SecurityEvent extends DomainResource { } } - public enum ObjectType { + public enum ObjectType implements FhirEnum { /** * Person. */ @@ -394,7 +406,10 @@ public class SecurityEvent extends DomainResource { * added to help the parsers */ NULL; - public static ObjectType fromCode(String codeString) throws Exception { + + public static final ObjectTypeEnumFactory ENUM_FACTORY = new ObjectTypeEnumFactory(); + + public static ObjectType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("1".equals(codeString)) @@ -405,8 +420,9 @@ public class SecurityEvent extends DomainResource { return _3; if ("4".equals(codeString)) return _4; - throw new Exception("Unknown ObjectType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObjectType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case _1: return "1"; @@ -445,8 +461,8 @@ public class SecurityEvent extends DomainResource { } } - public static class ObjectTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ObjectTypeEnumFactory implements EnumFactory { + public ObjectType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -458,9 +474,9 @@ public class SecurityEvent extends DomainResource { return ObjectType._3; if ("4".equals(codeString)) return ObjectType._4; - throw new Exception("Unknown ObjectType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObjectType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ObjectType code) throws IllegalArgumentException { if (code == ObjectType._1) return "1"; if (code == ObjectType._2) @@ -473,7 +489,7 @@ public class SecurityEvent extends DomainResource { } } - public enum ObjectRole { + public enum ObjectRole implements FhirEnum { /** * This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal. */ @@ -574,7 +590,10 @@ public class SecurityEvent extends DomainResource { * added to help the parsers */ NULL; - public static ObjectRole fromCode(String codeString) throws Exception { + + public static final ObjectRoleEnumFactory ENUM_FACTORY = new ObjectRoleEnumFactory(); + + public static ObjectRole fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("1".equals(codeString)) @@ -625,8 +644,9 @@ public class SecurityEvent extends DomainResource { return _23; if ("24".equals(codeString)) return _24; - throw new Exception("Unknown ObjectRole code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObjectRole code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case _1: return "1"; @@ -745,8 +765,8 @@ public class SecurityEvent extends DomainResource { } } - public static class ObjectRoleEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ObjectRoleEnumFactory implements EnumFactory { + public ObjectRole fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -798,9 +818,9 @@ public class SecurityEvent extends DomainResource { return ObjectRole._23; if ("24".equals(codeString)) return ObjectRole._24; - throw new Exception("Unknown ObjectRole code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObjectRole code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ObjectRole code) throws IllegalArgumentException { if (code == ObjectRole._1) return "1"; if (code == ObjectRole._2) @@ -853,7 +873,7 @@ public class SecurityEvent extends DomainResource { } } - public enum ObjectLifecycle { + public enum ObjectLifecycle implements FhirEnum { /** * Origination / Creation. */ @@ -918,7 +938,10 @@ public class SecurityEvent extends DomainResource { * added to help the parsers */ NULL; - public static ObjectLifecycle fromCode(String codeString) throws Exception { + + public static final ObjectLifecycleEnumFactory ENUM_FACTORY = new ObjectLifecycleEnumFactory(); + + public static ObjectLifecycle fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("1".equals(codeString)) @@ -951,8 +974,9 @@ public class SecurityEvent extends DomainResource { return _14; if ("15".equals(codeString)) return _15; - throw new Exception("Unknown ObjectLifecycle code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObjectLifecycle code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case _1: return "1"; @@ -1035,8 +1059,8 @@ public class SecurityEvent extends DomainResource { } } - public static class ObjectLifecycleEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ObjectLifecycleEnumFactory implements EnumFactory { + public ObjectLifecycle fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -1070,9 +1094,9 @@ public class SecurityEvent extends DomainResource { return ObjectLifecycle._14; if ("15".equals(codeString)) return ObjectLifecycle._15; - throw new Exception("Unknown ObjectLifecycle code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ObjectLifecycle code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ObjectLifecycle code) throws IllegalArgumentException { if (code == ObjectLifecycle._1) return "1"; if (code == ObjectLifecycle._2) @@ -1260,7 +1284,7 @@ public class SecurityEvent extends DomainResource { this.action = null; else { if (this.action == null) - this.action = new Enumeration(); + this.action = new Enumeration(SecurityEventAction.ENUM_FACTORY); this.action.setValue(value); } return this; @@ -1297,14 +1321,14 @@ public class SecurityEvent extends DomainResource { /** * @return The time when the event occurred on the source. */ - public DateAndTime getDateTime() { + public Date getDateTime() { return this.dateTime == null ? null : this.dateTime.getValue(); } /** * @param value The time when the event occurred on the source. */ - public SecurityEventEventComponent setDateTime(DateAndTime value) { + public SecurityEventEventComponent setDateTime(Date value) { if (this.dateTime == null) this.dateTime = new InstantType(); this.dateTime.setValue(value); @@ -1354,7 +1378,7 @@ public class SecurityEvent extends DomainResource { this.outcome = null; else { if (this.outcome == null) - this.outcome = new Enumeration(); + this.outcome = new Enumeration(SecurityEventOutcome.ENUM_FACTORY); this.outcome.setValue(value); } return this; @@ -1979,7 +2003,7 @@ public class SecurityEvent extends DomainResource { this.type = null; else { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(NetworkType.ENUM_FACTORY); this.type.setValue(value); } return this; @@ -2380,7 +2404,7 @@ public class SecurityEvent extends DomainResource { this.type = null; else { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(ObjectType.ENUM_FACTORY); this.type.setValue(value); } return this; @@ -2429,7 +2453,7 @@ public class SecurityEvent extends DomainResource { this.role = null; else { if (this.role == null) - this.role = new Enumeration(); + this.role = new Enumeration(ObjectRole.ENUM_FACTORY); this.role.setValue(value); } return this; @@ -2478,7 +2502,7 @@ public class SecurityEvent extends DomainResource { this.lifecycle = null; else { if (this.lifecycle == null) - this.lifecycle = new Enumeration(); + this.lifecycle = new Enumeration(ObjectLifecycle.ENUM_FACTORY); this.lifecycle.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SidType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SidType.java index 87a8e081ecb..e386c091458 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SidType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SidType.java @@ -25,11 +25,42 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + */ package org.hl7.fhir.instance.model; +import java.net.URI; + public class SidType extends UriType { - private static final long serialVersionUID = 5486832330986493589L; - + private static final long serialVersionUID = 2L; + + /** + * Constructor + */ + public SidType() { + super(); + } + + /** + * Constructor + */ + public SidType(String theValue) { + super(theValue); + } + + /** + * Constructor + */ + public SidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ + @Override + public SidType copy() { + return new SidType(getValue()); + } + } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Slot.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Slot.java index 3e9873d54a7..c1aab12bb87 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Slot.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Slot.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Slot", profile="http://hl7.org/fhir/Profile/Slot") public class Slot extends DomainResource { - public enum Slotstatus { + public enum Slotstatus implements FhirEnum { /** * Indicates that the time interval is busy because one or more events have been scheduled for that interval. */ @@ -66,7 +66,10 @@ public class Slot extends DomainResource { * added to help the parsers */ NULL; - public static Slotstatus fromCode(String codeString) throws Exception { + + public static final SlotstatusEnumFactory ENUM_FACTORY = new SlotstatusEnumFactory(); + + public static Slotstatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("BUSY".equals(codeString)) @@ -77,8 +80,9 @@ public class Slot extends DomainResource { return BUSYUNAVAILABLE; if ("BUSY-TENTATIVE".equals(codeString)) return BUSYTENTATIVE; - throw new Exception("Unknown Slotstatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Slotstatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case BUSY: return "BUSY"; @@ -117,8 +121,8 @@ public class Slot extends DomainResource { } } - public static class SlotstatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class SlotstatusEnumFactory implements EnumFactory { + public Slotstatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class Slot extends DomainResource { return Slotstatus.BUSYUNAVAILABLE; if ("BUSY-TENTATIVE".equals(codeString)) return Slotstatus.BUSYTENTATIVE; - throw new Exception("Unknown Slotstatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown Slotstatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(Slotstatus code) throws IllegalArgumentException { if (code == Slotstatus.BUSY) return "BUSY"; if (code == Slotstatus.FREE) @@ -365,7 +369,7 @@ public class Slot extends DomainResource { */ public Slot setFreeBusyType(Slotstatus value) { if (this.freeBusyType == null) - this.freeBusyType = new Enumeration(); + this.freeBusyType = new Enumeration(Slotstatus.ENUM_FACTORY); this.freeBusyType.setValue(value); return this; } @@ -401,14 +405,14 @@ public class Slot extends DomainResource { /** * @return Date/Time that the slot is to begin. */ - public DateAndTime getStart() { + public Date getStart() { return this.start == null ? null : this.start.getValue(); } /** * @param value Date/Time that the slot is to begin. */ - public Slot setStart(DateAndTime value) { + public Slot setStart(Date value) { if (this.start == null) this.start = new InstantType(); this.start.setValue(value); @@ -446,14 +450,14 @@ public class Slot extends DomainResource { /** * @return Date/Time that the slot is to conclude. */ - public DateAndTime getEnd() { + public Date getEnd() { return this.end == null ? null : this.end.getValue(); } /** * @param value Date/Time that the slot is to conclude. */ - public Slot setEnd(DateAndTime value) { + public Slot setEnd(Date value) { if (this.end == null) this.end = new InstantType(); this.end.setValue(value); @@ -589,14 +593,14 @@ public class Slot extends DomainResource { /** * @return When this slot was created, or last revised. */ - public DateAndTime getLastModified() { + public Date getLastModified() { return this.lastModified == null ? null : this.lastModified.getValue(); } /** * @param value When this slot was created, or last revised. */ - public Slot setLastModified(DateAndTime value) { + public Slot setLastModified(Date value) { if (value == null) this.lastModified = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Specimen.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Specimen.java index 92d1c32bd75..4f0df2b85c1 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Specimen.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Specimen.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Specimen", profile="http://hl7.org/fhir/Profile/Specimen") public class Specimen extends DomainResource { - public enum HierarchicalRelationshipType { + public enum HierarchicalRelationshipType implements FhirEnum { /** * The target resource is the parent of the focal specimen resource. */ @@ -58,15 +58,19 @@ public class Specimen extends DomainResource { * added to help the parsers */ NULL; - public static HierarchicalRelationshipType fromCode(String codeString) throws Exception { + + public static final HierarchicalRelationshipTypeEnumFactory ENUM_FACTORY = new HierarchicalRelationshipTypeEnumFactory(); + + public static HierarchicalRelationshipType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("parent".equals(codeString)) return PARENT; if ("child".equals(codeString)) return CHILD; - throw new Exception("Unknown HierarchicalRelationshipType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown HierarchicalRelationshipType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case PARENT: return "parent"; @@ -97,8 +101,8 @@ public class Specimen extends DomainResource { } } - public static class HierarchicalRelationshipTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class HierarchicalRelationshipTypeEnumFactory implements EnumFactory { + public HierarchicalRelationshipType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -106,9 +110,9 @@ public class Specimen extends DomainResource { return HierarchicalRelationshipType.PARENT; if ("child".equals(codeString)) return HierarchicalRelationshipType.CHILD; - throw new Exception("Unknown HierarchicalRelationshipType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown HierarchicalRelationshipType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(HierarchicalRelationshipType code) throws IllegalArgumentException { if (code == HierarchicalRelationshipType.PARENT) return "parent"; if (code == HierarchicalRelationshipType.CHILD) @@ -189,7 +193,7 @@ public class Specimen extends DomainResource { */ public SpecimenSourceComponent setRelationship(HierarchicalRelationshipType value) { if (this.relationship == null) - this.relationship = new Enumeration(); + this.relationship = new Enumeration(HierarchicalRelationshipType.ENUM_FACTORY); this.relationship.setValue(value); return this; } @@ -1280,14 +1284,14 @@ public class Specimen extends DomainResource { /** * @return Time when specimen was received for processing or testing. */ - public DateAndTime getReceivedTime() { + public Date getReceivedTime() { return this.receivedTime == null ? null : this.receivedTime.getValue(); } /** * @param value Time when specimen was received for processing or testing. */ - public Specimen setReceivedTime(DateAndTime value) { + public Specimen setReceivedTime(Date value) { if (value == null) this.receivedTime = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusRequest.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusRequest.java index 57fbd38b858..2952273bb16 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusRequest.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusRequest.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -68,9 +68,9 @@ public class StatusRequest extends DomainResource { /** * The date when this resource was created. */ - @Child(name="date", type={DateType.class}, order=2, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who is target of the request. @@ -132,7 +132,7 @@ public class StatusRequest extends DomainResource { */ protected Resource responseTarget; - private static final long serialVersionUID = 892209905L; + private static final long serialVersionUID = 2018065278L; public StatusRequest() { super(); @@ -217,50 +217,50 @@ public class StatusRequest extends DomainResource { } /** - * @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusRequest.date"); + throw new Error("Attempt to auto-create StatusRequest.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public StatusRequest setDateElement(DateType value) { - this.date = value; + public StatusRequest setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when this resource was created. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when this resource was created. */ - public StatusRequest setDate(DateAndTime value) { + public StatusRequest setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -480,7 +480,7 @@ public class StatusRequest extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); @@ -498,7 +498,7 @@ public class StatusRequest extends DomainResource { }; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); @@ -513,7 +513,7 @@ public class StatusRequest extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) && (request == null || request.isEmpty()) && (response == null || response.isEmpty()); } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusResponse.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusResponse.java index 739caee5dd5..f63d9d155c5 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusResponse.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StatusResponse.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -211,9 +211,9 @@ public class StatusResponse extends DomainResource { /** * The date when the enclosed suite of services were performed or completed. */ - @Child(name="date", type={DateType.class}, order=5, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=5, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer who produced this adjudicated response. @@ -272,7 +272,7 @@ public class StatusResponse extends DomainResource { @Description(shortDefinition="Error code", formalDefinition="Processing errors." ) protected List error; - private static final long serialVersionUID = -1776739053L; + private static final long serialVersionUID = 342376292L; public StatusResponse() { super(); @@ -474,50 +474,50 @@ public class StatusResponse extends DomainResource { } /** - * @return {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StatusResponse.date"); + throw new Error("Attempt to auto-create StatusResponse.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public StatusResponse setDateElement(DateType value) { - this.date = value; + public StatusResponse setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when the enclosed suite of services were performed or completed. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when the enclosed suite of services were performed or completed. */ - public StatusResponse setDate(DateAndTime value) { + public StatusResponse setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -746,7 +746,7 @@ public class StatusResponse extends DomainResource { childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication or processing.", 0, java.lang.Integer.MAX_VALUE, disposition)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); @@ -768,7 +768,7 @@ public class StatusResponse extends DomainResource { dst.disposition = disposition == null ? null : disposition.copy(); dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.organization = organization == null ? null : organization.copy(); dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); @@ -794,9 +794,10 @@ public class StatusResponse extends DomainResource { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (date == null || date.isEmpty()) && (organization == null || organization.isEmpty()) && (requestProvider == null || requestProvider.isEmpty()) - && (requestOrganization == null || requestOrganization.isEmpty()) && (form == null || form.isEmpty()) - && (notes == null || notes.isEmpty()) && (error == null || error.isEmpty()); + && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) + && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) + && (form == null || form.isEmpty()) && (notes == null || notes.isEmpty()) && (error == null || error.isEmpty()) + ; } @Override diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StringType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StringType.java index 06831f61079..75f05ad4c94 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StringType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/StringType.java @@ -28,62 +28,72 @@ POSSIBILITY OF SUCH DAMAGE. */ package org.hl7.fhir.instance.model; +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.annotations.DatatypeDef; + + /** * Primitive type "string" in FHIR - any sequence of unicode characters less than 1MB in length */ +@DatatypeDef(name = "string") +public class StringType extends PrimitiveType { -public class StringType extends PrimitiveType { + private static final long serialVersionUID = 2L; - private static final long serialVersionUID = 4115820767194238069L; /** - * The string value + * Create a new String */ - private String value; - - public StringType() { - } - - public StringType(String value) { - this.value = value; - } - - /** - * @return the string value - */ - public String getValue() { - return value; + public StringType() { + super(); } /** - * @param value the value of the string + * Create a new String */ - public StringType setValue(String value) { - this.value = value; - return this; - } - - @Override - public StringType copy() { - StringType dst = new StringType(); - dst.value = value; - return dst; - } - - @Override - protected Type typedCopy() { - return copy(); + public StringType(String theValue) { + setValue(theValue); } - @Override - public String asStringValue() { - return value; - } + /** + * Returns the value of this StringType, or an empty string ("") if the + * value is null. This method is provided as a convenience to + * users of this API. + */ + public String getValueNotNull() { + return StringUtils.defaultString(getValue()); + } + /** + * Returns the value of this string, or null if no value + * is present + */ + @Override + public String toString() { + return getValue(); + } + + /** + * Returns true if this datatype has no extensions, and has either a null value or an empty ("") value. + */ + @Override public boolean isEmpty() { - return super.isEmpty() && value == null; + boolean retVal = super.isEmpty() && StringUtils.isBlank(getValue()); + return retVal; + } + + @Override + protected String parse(String theValue) { + return theValue; + } + + @Override + protected String encode(String theValue) { + return theValue; + } + + @Override + public StringType copy() { + return new StringType(getValue()); } - public boolean hasValue() { - return value != null; - } } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Subscription.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Subscription.java index 1d4e62fb59d..0400e2ed0b3 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Subscription.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Subscription.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Subscription", profile="http://hl7.org/fhir/Profile/Subscription") public class Subscription extends DomainResource { - public enum SubscriptionStatus { + public enum SubscriptionStatus implements FhirEnum { /** * The client has requested the subscription, and the server has not yet set it up. */ @@ -66,7 +66,10 @@ public class Subscription extends DomainResource { * added to help the parsers */ NULL; - public static SubscriptionStatus fromCode(String codeString) throws Exception { + + public static final SubscriptionStatusEnumFactory ENUM_FACTORY = new SubscriptionStatusEnumFactory(); + + public static SubscriptionStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("requested".equals(codeString)) @@ -77,8 +80,9 @@ public class Subscription extends DomainResource { return ERROR; if ("off".equals(codeString)) return OFF; - throw new Exception("Unknown SubscriptionStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUESTED: return "requested"; @@ -117,8 +121,8 @@ public class Subscription extends DomainResource { } } - public static class SubscriptionStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class SubscriptionStatusEnumFactory implements EnumFactory { + public SubscriptionStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -130,9 +134,9 @@ public class Subscription extends DomainResource { return SubscriptionStatus.ERROR; if ("off".equals(codeString)) return SubscriptionStatus.OFF; - throw new Exception("Unknown SubscriptionStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(SubscriptionStatus code) throws IllegalArgumentException { if (code == SubscriptionStatus.REQUESTED) return "requested"; if (code == SubscriptionStatus.ACTIVE) @@ -145,7 +149,7 @@ public class Subscription extends DomainResource { } } - public enum SubscriptionChannelType { + public enum SubscriptionChannelType implements FhirEnum { /** * The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made. */ @@ -170,7 +174,10 @@ public class Subscription extends DomainResource { * added to help the parsers */ NULL; - public static SubscriptionChannelType fromCode(String codeString) throws Exception { + + public static final SubscriptionChannelTypeEnumFactory ENUM_FACTORY = new SubscriptionChannelTypeEnumFactory(); + + public static SubscriptionChannelType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("rest-hook".equals(codeString)) @@ -183,8 +190,9 @@ public class Subscription extends DomainResource { return SMS; if ("message".equals(codeString)) return MESSAGE; - throw new Exception("Unknown SubscriptionChannelType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case RESTHOOK: return "rest-hook"; @@ -227,8 +235,8 @@ public class Subscription extends DomainResource { } } - public static class SubscriptionChannelTypeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class SubscriptionChannelTypeEnumFactory implements EnumFactory { + public SubscriptionChannelType fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -242,9 +250,9 @@ public class Subscription extends DomainResource { return SubscriptionChannelType.SMS; if ("message".equals(codeString)) return SubscriptionChannelType.MESSAGE; - throw new Exception("Unknown SubscriptionChannelType code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(SubscriptionChannelType code) throws IllegalArgumentException { if (code == SubscriptionChannelType.RESTHOOK) return "rest-hook"; if (code == SubscriptionChannelType.WEBSOCKET) @@ -341,7 +349,7 @@ public class Subscription extends DomainResource { */ public SubscriptionChannelComponent setType(SubscriptionChannelType value) { if (this.type == null) - this.type = new Enumeration(); + this.type = new Enumeration(SubscriptionChannelType.ENUM_FACTORY); this.type.setValue(value); return this; } @@ -941,7 +949,7 @@ public class Subscription extends DomainResource { */ public Subscription setStatus(SubscriptionStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(SubscriptionStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -1050,14 +1058,14 @@ public class Subscription extends DomainResource { /** * @return Todo. */ - public DateAndTime getEnd() { + public Date getEnd() { return this.end == null ? null : this.end.getValue(); } /** * @param value Todo. */ - public Subscription setEnd(DateAndTime value) { + public Subscription setEnd(Date value) { if (value == null) this.end = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Substance.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Substance.java index 71ef9e60deb..b4246cfec0a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Substance.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Substance.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -129,14 +129,14 @@ public class Substance extends DomainResource { /** * @return When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. */ - public DateAndTime getExpiry() { + public Date getExpiry() { return this.expiry == null ? null : this.expiry.getValue(); } /** * @param value When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. */ - public SubstanceInstanceComponent setExpiry(DateAndTime value) { + public SubstanceInstanceComponent setExpiry(Date value) { if (value == null) this.expiry = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Supply.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Supply.java index b53b5ae9a7b..1bc398ab0b8 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Supply.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Supply.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="Supply", profile="http://hl7.org/fhir/Profile/Supply") public class Supply extends DomainResource { - public enum ValuesetSupplyStatus { + public enum ValuesetSupplyStatus implements FhirEnum { /** * Supply has been requested, but not dispensed. */ @@ -70,7 +70,10 @@ public class Supply extends DomainResource { * added to help the parsers */ NULL; - public static ValuesetSupplyStatus fromCode(String codeString) throws Exception { + + public static final ValuesetSupplyStatusEnumFactory ENUM_FACTORY = new ValuesetSupplyStatusEnumFactory(); + + public static ValuesetSupplyStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("requested".equals(codeString)) @@ -83,8 +86,9 @@ public class Supply extends DomainResource { return FAILED; if ("cancelled".equals(codeString)) return CANCELLED; - throw new Exception("Unknown ValuesetSupplyStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ValuesetSupplyStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case REQUESTED: return "requested"; @@ -127,8 +131,8 @@ public class Supply extends DomainResource { } } - public static class ValuesetSupplyStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ValuesetSupplyStatusEnumFactory implements EnumFactory { + public ValuesetSupplyStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -142,9 +146,9 @@ public class Supply extends DomainResource { return ValuesetSupplyStatus.FAILED; if ("cancelled".equals(codeString)) return ValuesetSupplyStatus.CANCELLED; - throw new Exception("Unknown ValuesetSupplyStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ValuesetSupplyStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ValuesetSupplyStatus code) throws IllegalArgumentException { if (code == ValuesetSupplyStatus.REQUESTED) return "requested"; if (code == ValuesetSupplyStatus.DISPENSED) @@ -159,7 +163,7 @@ public class Supply extends DomainResource { } } - public enum ValuesetSupplyDispenseStatus { + public enum ValuesetSupplyDispenseStatus implements FhirEnum { /** * Supply has been requested, but not dispensed. */ @@ -176,7 +180,10 @@ public class Supply extends DomainResource { * added to help the parsers */ NULL; - public static ValuesetSupplyDispenseStatus fromCode(String codeString) throws Exception { + + public static final ValuesetSupplyDispenseStatusEnumFactory ENUM_FACTORY = new ValuesetSupplyDispenseStatusEnumFactory(); + + public static ValuesetSupplyDispenseStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("in progress".equals(codeString)) @@ -185,8 +192,9 @@ public class Supply extends DomainResource { return DISPENSED; if ("abandoned".equals(codeString)) return ABANDONED; - throw new Exception("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case INPROGRESS: return "in progress"; @@ -221,8 +229,8 @@ public class Supply extends DomainResource { } } - public static class ValuesetSupplyDispenseStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ValuesetSupplyDispenseStatusEnumFactory implements EnumFactory { + public ValuesetSupplyDispenseStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -232,9 +240,9 @@ public class Supply extends DomainResource { return ValuesetSupplyDispenseStatus.DISPENSED; if ("abandoned".equals(codeString)) return ValuesetSupplyDispenseStatus.ABANDONED; - throw new Exception("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ValuesetSupplyDispenseStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ValuesetSupplyDispenseStatus code) throws IllegalArgumentException { if (code == ValuesetSupplyDispenseStatus.INPROGRESS) return "in progress"; if (code == ValuesetSupplyDispenseStatus.DISPENSED) @@ -410,7 +418,7 @@ public class Supply extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ValuesetSupplyDispenseStatus.ENUM_FACTORY); this.status.setValue(value); } return this; @@ -883,7 +891,7 @@ public class Supply extends DomainResource { this.status = null; else { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ValuesetSupplyStatus.ENUM_FACTORY); this.status.setValue(value); } return this; diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SupportingDocumentation.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SupportingDocumentation.java index 89e33443873..9d20141f981 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SupportingDocumentation.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/SupportingDocumentation.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -192,14 +192,14 @@ public class SupportingDocumentation extends DomainResource { /** * @return The date and optionally time when the material was created. */ - public DateAndTime getDateTime() { + public Date getDateTime() { return this.dateTime == null ? null : this.dateTime.getValue(); } /** * @param value The date and optionally time when the material was created. */ - public SupportingDocumentationDetailComponent setDateTime(DateAndTime value) { + public SupportingDocumentationDetailComponent setDateTime(Date value) { if (value == null) this.dateTime = null; else { @@ -257,9 +257,9 @@ public class SupportingDocumentation extends DomainResource { /** * The date when this resource was created. */ - @Child(name="date", type={DateType.class}, order=2, min=0, max=1) + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateType date; + protected DateTimeType created; /** * The Insurer, organization or Provider who is target of the submission. @@ -352,7 +352,7 @@ public class SupportingDocumentation extends DomainResource { @Description(shortDefinition="Supporting Files", formalDefinition="Supporting Files." ) protected List detail; - private static final long serialVersionUID = -1532144943L; + private static final long serialVersionUID = -1353519836L; public SupportingDocumentation() { super(); @@ -437,50 +437,50 @@ public class SupportingDocumentation extends DomainResource { } /** - * @return {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public DateType getDateElement() { - if (this.date == null) + public DateTimeType getCreatedElement() { + if (this.created == null) if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupportingDocumentation.date"); + throw new Error("Attempt to auto-create SupportingDocumentation.created"); else if (Configuration.doAutoCreate()) - this.date = new DateType(); - return this.date; + this.created = new DateTimeType(); + return this.created; } - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); } - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); } /** - * @param value {@link #date} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value + * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value */ - public SupportingDocumentation setDateElement(DateType value) { - this.date = value; + public SupportingDocumentation setCreatedElement(DateTimeType value) { + this.created = value; return this; } /** * @return The date when this resource was created. */ - public DateAndTime getDate() { - return this.date == null ? null : this.date.getValue(); + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); } /** * @param value The date when this resource was created. */ - public SupportingDocumentation setDate(DateAndTime value) { + public SupportingDocumentation setCreated(Date value) { if (value == null) - this.date = null; + this.created = null; else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); } return this; } @@ -813,7 +813,7 @@ public class SupportingDocumentation extends DomainResource { childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("date", "date", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, date)); + childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); childrenList.add(new Property("target", "Reference(Organization|Practitioner)", "The Insurer, organization or Provider who is target of the submission.", 0, java.lang.Integer.MAX_VALUE, target)); childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); @@ -834,7 +834,7 @@ public class SupportingDocumentation extends DomainResource { }; dst.ruleset = ruleset == null ? null : ruleset.copy(); dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.date = date == null ? null : date.copy(); + dst.created = created == null ? null : created.copy(); dst.target = target == null ? null : target.copy(); dst.provider = provider == null ? null : provider.copy(); dst.organization = organization == null ? null : organization.copy(); @@ -856,7 +856,7 @@ public class SupportingDocumentation extends DomainResource { public boolean isEmpty() { return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (date == null || date.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (author == null || author.isEmpty()) && (subject == null || subject.isEmpty()) && (detail == null || detail.isEmpty()); diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/TemporalPrecisionEnum.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/TemporalPrecisionEnum.java index 7b415e13db8..e0c6d727e46 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/TemporalPrecisionEnum.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/TemporalPrecisionEnum.java @@ -26,13 +26,18 @@ public enum TemporalPrecisionEnum { return DateUtils.addDays(theInput, theAmount); } }, + MINUTE(Calendar.MINUTE) { + @Override + public Date add(Date theInput, int theAmount) { + return DateUtils.addMinutes(theInput, theAmount); + } + }, SECOND(Calendar.SECOND) { @Override public Date add(Date theInput, int theAmount) { return DateUtils.addSeconds(theInput, theAmount); } }, - MILLI(Calendar.MILLISECOND) { @Override public Date add(Date theInput, int theAmount) { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Timing.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Timing.java index db7f7c75ce9..e2e27907e5a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Timing.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Timing.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -44,7 +44,7 @@ import org.hl7.fhir.instance.model.annotations.DatatypeDef; @DatatypeDef(name="Timing") public class Timing extends Type { - public enum EventTiming { + public enum EventTiming implements FhirEnum { /** * event occurs [duration] before the hour of sleep (or trying to). */ @@ -89,7 +89,10 @@ public class Timing extends Type { * added to help the parsers */ NULL; - public static EventTiming fromCode(String codeString) throws Exception { + + public static final EventTimingEnumFactory ENUM_FACTORY = new EventTimingEnumFactory(); + + public static EventTiming fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("HS".equals(codeString)) @@ -112,8 +115,9 @@ public class Timing extends Type { return PCD; if ("PCV".equals(codeString)) return PCV; - throw new Exception("Unknown EventTiming code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case HS: return "HS"; @@ -176,8 +180,8 @@ public class Timing extends Type { } } - public static class EventTimingEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class EventTimingEnumFactory implements EnumFactory { + public EventTiming fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -201,9 +205,9 @@ public class Timing extends Type { return EventTiming.PCD; if ("PCV".equals(codeString)) return EventTiming.PCV; - throw new Exception("Unknown EventTiming code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(EventTiming code) throws IllegalArgumentException { if (code == EventTiming.HS) return "HS"; if (code == EventTiming.WAKE) @@ -228,7 +232,7 @@ public class Timing extends Type { } } - public enum UnitsOfTime { + public enum UnitsOfTime implements FhirEnum { /** * second. */ @@ -261,7 +265,10 @@ public class Timing extends Type { * added to help the parsers */ NULL; - public static UnitsOfTime fromCode(String codeString) throws Exception { + + public static final UnitsOfTimeEnumFactory ENUM_FACTORY = new UnitsOfTimeEnumFactory(); + + public static UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("s".equals(codeString)) @@ -278,8 +285,9 @@ public class Timing extends Type { return MO; if ("a".equals(codeString)) return A; - throw new Exception("Unknown UnitsOfTime code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case S: return "s"; @@ -330,8 +338,8 @@ public class Timing extends Type { } } - public static class UnitsOfTimeEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class UnitsOfTimeEnumFactory implements EnumFactory { + public UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -349,9 +357,9 @@ public class Timing extends Type { return UnitsOfTime.MO; if ("a".equals(codeString)) return UnitsOfTime.A; - throw new Exception("Unknown UnitsOfTime code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(UnitsOfTime code) throws IllegalArgumentException { if (code == UnitsOfTime.S) return "s"; if (code == UnitsOfTime.MIN) @@ -517,7 +525,7 @@ public class Timing extends Type { this.when = null; else { if (this.when == null) - this.when = new Enumeration(); + this.when = new Enumeration(EventTiming.ENUM_FACTORY); this.when.setValue(value); } return this; @@ -608,7 +616,7 @@ public class Timing extends Type { */ public TimingRepeatComponent setUnits(UnitsOfTime value) { if (this.units == null) - this.units = new Enumeration(); + this.units = new Enumeration(UnitsOfTime.ENUM_FACTORY); this.units.setValue(value); return this; } @@ -693,14 +701,14 @@ public class Timing extends Type { /** * @return When to stop repeating the timing schedule. */ - public DateAndTime getEnd() { + public Date getEnd() { return this.end == null ? null : this.end.getValue(); } /** * @param value When to stop repeating the timing schedule. */ - public TimingRepeatComponent setEnd(DateAndTime value) { + public TimingRepeatComponent setEnd(Date value) { if (value == null) this.end = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Type.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Type.java index c1776d4f50e..dfc9fd3a78a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Type.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/Type.java @@ -33,8 +33,11 @@ package org.hl7.fhir.instance.model; */ public abstract class Type extends Element { - private static final long serialVersionUID = 4623040030733049991L; + private static final long serialVersionUID = 4623040030733049991L; - public abstract Type copy(); + public Type copy() { + return typedCopy(); + } + protected abstract Type typedCopy(); } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UriType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UriType.java index 1288f93652a..38805a1724a 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UriType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UriType.java @@ -34,17 +34,13 @@ import java.net.URISyntaxException; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.model.annotations.DatatypeDef; -import ca.uhn.fhir.parser.DataFormatException; - /** * Primitive type "uri" in FHIR: any valid URI. Sometimes constrained to be only an absolute URI, and sometimes constrained to be a literal reference */ @DatatypeDef(name = "uri") -public class UriType extends PrimitiveType { +public class UriType extends PrimitiveType { private static final long serialVersionUID = 1L; - - private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(UriType.class); /** * Constructor @@ -64,7 +60,7 @@ public class UriType extends PrimitiveType { * Constructor */ public UriType(URI theValue) { - setValue(theValue); + setValue(theValue.toString()); } @Override @@ -73,8 +69,8 @@ public class UriType extends PrimitiveType { } @Override - protected String encode(URI theValue) { - return getValue().toASCIIString(); + protected String encode(String theValue) { + return theValue; } @Override @@ -94,8 +90,8 @@ public class UriType extends PrimitiveType { return false; } - URI normalize = normalize(getValue()); - URI normalize2 = normalize(other.getValue()); + String normalize = normalize(getValue()); + String normalize2 = normalize(other.getValue()); return normalize.equals(normalize2); } @@ -113,51 +109,48 @@ public class UriType extends PrimitiveType { final int prime = 31; int result = 1; - URI normalize = normalize(getValue()); + String normalize = normalize(getValue()); result = prime * result + ((normalize == null) ? 0 : normalize.hashCode()); return result; } - private URI normalize(URI theValue) { + private String normalize(String theValue) { if (theValue == null) { return null; } - URI retVal = (theValue.normalize()); - String urlString = retVal.toString(); - if (urlString.endsWith("/") && urlString.length() > 1) { - try { + try { + URI retVal = new URI(getValue()).normalize(); + String urlString = retVal.toString(); + if (urlString.endsWith("/") && urlString.length() > 1) { retVal = new URI(urlString.substring(0, urlString.length() - 1)); - } catch (URISyntaxException e) { - ourLog.debug("Failed to normalize URL '{}', message was: {}", urlString, e.toString()); } + return retVal.toASCIIString(); + } catch (URISyntaxException e) { + // ourLog.debug("Failed to normalize URL '{}', message was: {}", urlString, e.toString()); + return theValue; } - return retVal; } @Override - protected URI parse(String theValue) { - try { - return new URI(theValue); - } catch (URISyntaxException e) { - throw new DataFormatException("Unable to parse URI value", e); - } + protected String parse(String theValue) { + return theValue; } /** - * Creates a new UriDt instance which uses the given OID as the content (and prepends "urn:oid:" to the OID string - * in the value of the newly created UriDt, per the FHIR specification). + * Creates a new OidType instance which uses the given OID as the content (and prepends "urn:oid:" to the OID string + * in the value of the newly created OidType, per the FHIR specification). * * @param theOid * The OID to use (null is acceptable and will result in a UriDt instance with a * null value) * @return A new UriDt instance */ - public static UriType fromOid(String theOid) { + public static OidType fromOid(String theOid) { if (theOid == null) { - return new UriType(); + return new OidType(); } - return new UriType("urn:oid:" + theOid); + return new OidType("urn:oid:" + theOid); } } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UuidType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UuidType.java index eef4b76c4f7..1e3c9a2f963 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UuidType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/UuidType.java @@ -28,16 +28,39 @@ POSSIBILITY OF SUCH DAMAGE. */ package org.hl7.fhir.instance.model; +import java.net.URI; + public class UuidType extends UriType { - public UuidType(String value) { - this.value = value; - } + private static final long serialVersionUID = 2L; - public UuidType() { - } + /** + * Constructor + */ + public UuidType() { + super(); + } - private static final long serialVersionUID = -2355185818258961443L; + /** + * Constructor + */ + public UuidType(String theValue) { + super(theValue); + } + /** + * Constructor + */ + public UuidType(URI theValue) { + super(theValue); + } + + /** + * Constructor + */ + @Override + public UuidType copy() { + return new UuidType(getValue()); + } } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ValueSet.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ValueSet.java index d11d8ddad49..300adf72803 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ValueSet.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/ValueSet.java @@ -29,7 +29,7 @@ package org.hl7.fhir.instance.model; */ -// Generated on Tue, Dec 2, 2014 21:09+1100 for FHIR v0.3.0 +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 import java.util.*; @@ -45,7 +45,7 @@ import org.hl7.fhir.instance.model.annotations.Description; @ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/Profile/ValueSet") public class ValueSet extends DomainResource { - public enum ValuesetStatus { + public enum ValuesetStatus implements FhirEnum { /** * This valueset is still under development. */ @@ -62,7 +62,10 @@ public class ValueSet extends DomainResource { * added to help the parsers */ NULL; - public static ValuesetStatus fromCode(String codeString) throws Exception { + + public static final ValuesetStatusEnumFactory ENUM_FACTORY = new ValuesetStatusEnumFactory(); + + public static ValuesetStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("draft".equals(codeString)) @@ -71,8 +74,9 @@ public class ValueSet extends DomainResource { return ACTIVE; if ("retired".equals(codeString)) return RETIRED; - throw new Exception("Unknown ValuesetStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case DRAFT: return "draft"; @@ -107,8 +111,8 @@ public class ValueSet extends DomainResource { } } - public static class ValuesetStatusEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class ValuesetStatusEnumFactory implements EnumFactory { + public ValuesetStatus fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -118,9 +122,9 @@ public class ValueSet extends DomainResource { return ValuesetStatus.ACTIVE; if ("retired".equals(codeString)) return ValuesetStatus.RETIRED; - throw new Exception("Unknown ValuesetStatus code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown ValuesetStatus code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(ValuesetStatus code) throws IllegalArgumentException { if (code == ValuesetStatus.DRAFT) return "draft"; if (code == ValuesetStatus.ACTIVE) @@ -131,7 +135,7 @@ public class ValueSet extends DomainResource { } } - public enum FilterOperator { + public enum FilterOperator implements FhirEnum { /** * The specified property of the code equals the provided value. */ @@ -160,7 +164,10 @@ public class ValueSet extends DomainResource { * added to help the parsers */ NULL; - public static FilterOperator fromCode(String codeString) throws Exception { + + public static final FilterOperatorEnumFactory ENUM_FACTORY = new FilterOperatorEnumFactory(); + + public static FilterOperator fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) return null; if ("=".equals(codeString)) @@ -175,8 +182,9 @@ public class ValueSet extends DomainResource { return IN; if ("not in".equals(codeString)) return NOTIN; - throw new Exception("Unknown FilterOperator code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); } + @Override public String toCode() { switch (this) { case EQUAL: return "="; @@ -223,8 +231,8 @@ public class ValueSet extends DomainResource { } } - public static class FilterOperatorEnumFactory implements EnumFactory { - public Enum fromCode(String codeString) throws Exception { + public static class FilterOperatorEnumFactory implements EnumFactory { + public FilterOperator fromCode(String codeString) throws IllegalArgumentException { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; @@ -240,9 +248,9 @@ public class ValueSet extends DomainResource { return FilterOperator.IN; if ("not in".equals(codeString)) return FilterOperator.NOTIN; - throw new Exception("Unknown FilterOperator code '"+codeString+"'"); + throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); } - public String toCode(Enum code) throws Exception { + public String toCode(FilterOperator code) throws IllegalArgumentException { if (code == FilterOperator.EQUAL) return "="; if (code == FilterOperator.ISA) @@ -1736,7 +1744,7 @@ public class ValueSet extends DomainResource { */ public ConceptSetFilterComponent setOp(FilterOperator value) { if (this.op == null) - this.op = new Enumeration(); + this.op = new Enumeration(FilterOperator.ENUM_FACTORY); this.op.setValue(value); return this; } @@ -1898,14 +1906,14 @@ public class ValueSet extends DomainResource { /** * @return The time at which the expansion was produced by the expanding system. */ - public DateAndTime getTimestamp() { + public Date getTimestamp() { return this.timestamp == null ? null : this.timestamp.getValue(); } /** * @param value The time at which the expansion was produced by the expanding system. */ - public ValueSetExpansionComponent setTimestamp(DateAndTime value) { + public ValueSetExpansionComponent setTimestamp(Date value) { if (this.timestamp == null) this.timestamp = new DateTimeType(); this.timestamp.setValue(value); @@ -2920,7 +2928,7 @@ public class ValueSet extends DomainResource { */ public ValueSet setStatus(ValuesetStatus value) { if (this.status == null) - this.status = new Enumeration(); + this.status = new Enumeration(ValuesetStatus.ENUM_FACTORY); this.status.setValue(value); return this; } @@ -3054,14 +3062,14 @@ public class ValueSet extends DomainResource { /** * @return The date that the value set status was last changed. */ - public DateAndTime getDate() { + public Date getDate() { return this.date == null ? null : this.date.getValue(); } /** * @param value The date that the value set status was last changed. */ - public ValueSet setDate(DateAndTime value) { + public ValueSet setDate(Date value) { if (value == null) this.date = null; else { @@ -3103,14 +3111,14 @@ public class ValueSet extends DomainResource { /** * @return If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date. */ - public DateAndTime getStableDate() { + public Date getStableDate() { return this.stableDate == null ? null : this.stableDate.getValue(); } /** * @param value If a Stability Date is expanded by evaluating the Content Logical Definition using the current version of all referenced code system(s) and value sets as of the Stability Date. */ - public ValueSet setStableDate(DateAndTime value) { + public ValueSet setStableDate(Date value) { if (value == null) this.stableDate = null; else { diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/VisionClaim.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/VisionClaim.java new file mode 100644 index 00000000000..472dba777f4 --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/VisionClaim.java @@ -0,0 +1,3786 @@ +package org.hl7.fhir.instance.model; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Sun, Dec 7, 2014 21:45-0500 for FHIR v0.3.0 + +import java.util.*; + +import java.math.*; +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.instance.model.annotations.ResourceDef; +import org.hl7.fhir.instance.model.annotations.SearchParamDefinition; +import org.hl7.fhir.instance.model.annotations.Block; +import org.hl7.fhir.instance.model.annotations.Child; +import org.hl7.fhir.instance.model.annotations.Description; +/** + * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + */ +@ResourceDef(name="VisionClaim", profile="http://hl7.org/fhir/Profile/VisionClaim") +public class VisionClaim extends DomainResource { + + public enum UseLink implements FhirEnum { + /** + * The treatment is complete and this represents a Claim for the services. + */ + COMPLETE, + /** + * The treatment is proposed and this represents a Pre-authorization for the services. + */ + PROPOSED, + /** + * The treatment is proposed and this represents a Pre-determination for the services. + */ + EXPLORATORY, + /** + * A locally defined or otherwise resolved status. + */ + OTHER, + /** + * added to help the parsers + */ + NULL; + + public static final UseLinkEnumFactory ENUM_FACTORY = new UseLinkEnumFactory(); + + public static UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return COMPLETE; + if ("proposed".equals(codeString)) + return PROPOSED; + if ("exploratory".equals(codeString)) + return EXPLORATORY; + if ("other".equals(codeString)) + return OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + @Override + public String toCode() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + public String getSystem() { + switch (this) { + case COMPLETE: return ""; + case PROPOSED: return ""; + case EXPLORATORY: return ""; + case OTHER: return ""; + default: return "?"; + } + } + public String getDefinition() { + switch (this) { + case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; + case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; + case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; + case OTHER: return "A locally defined or otherwise resolved status."; + default: return "?"; + } + } + public String getDisplay() { + switch (this) { + case COMPLETE: return "complete"; + case PROPOSED: return "proposed"; + case EXPLORATORY: return "exploratory"; + case OTHER: return "other"; + default: return "?"; + } + } + } + + public static class UseLinkEnumFactory implements EnumFactory { + public UseLink fromCode(String codeString) throws IllegalArgumentException { + if (codeString == null || "".equals(codeString)) + if (codeString == null || "".equals(codeString)) + return null; + if ("complete".equals(codeString)) + return UseLink.COMPLETE; + if ("proposed".equals(codeString)) + return UseLink.PROPOSED; + if ("exploratory".equals(codeString)) + return UseLink.EXPLORATORY; + if ("other".equals(codeString)) + return UseLink.OTHER; + throw new IllegalArgumentException("Unknown UseLink code '"+codeString+"'"); + } + public String toCode(UseLink code) throws IllegalArgumentException { + if (code == UseLink.COMPLETE) + return "complete"; + if (code == UseLink.PROPOSED) + return "proposed"; + if (code == UseLink.EXPLORATORY) + return "exploratory"; + if (code == UseLink.OTHER) + return "other"; + return "?"; + } + } + + @Block() + public static class PayeeComponent extends BackboneElement { + /** + * Party to be reimbursed: Subscriber, provider, other. + */ + @Child(name="type", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) + protected Coding type; + + /** + * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="provider", type={Practitioner.class}, order=2, min=0, max=1) + @Description(shortDefinition="Provider who is the payee", formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Practitioner providerTarget; + + /** + * The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="organization", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Organization who is the payee", formalDefinition="The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Organization organizationTarget; + + /** + * The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + */ + @Child(name="person", type={Patient.class}, order=4, min=0, max=1) + @Description(shortDefinition="Other person who is the payee", formalDefinition="The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned)." ) + protected Reference person; + + /** + * The actual object that is the target of the reference (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + protected Patient personTarget; + + private static final long serialVersionUID = -503108488L; + + public PayeeComponent() { + super(); + } + + /** + * @return {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (Party to be reimbursed: Subscriber, provider, other.) + */ + public PayeeComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Reference getPerson() { + if (this.person == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.person = new Reference(); + return this.person; + } + + public boolean hasPerson() { + return this.person != null && !this.person.isEmpty(); + } + + /** + * @param value {@link #person} (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPerson(Reference value) { + this.person = value; + return this; + } + + /** + * @return {@link #person} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public Patient getPersonTarget() { + if (this.personTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create PayeeComponent.person"); + else if (Configuration.doAutoCreate()) + this.personTarget = new Patient(); + return this.personTarget; + } + + /** + * @param value {@link #person} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).) + */ + public PayeeComponent setPersonTarget(Patient value) { + this.personTarget = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("type", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("person", "Reference(Patient)", "The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned).", 0, java.lang.Integer.MAX_VALUE, person)); + } + + public PayeeComponent copy() { + PayeeComponent dst = new PayeeComponent(); + copyValues(dst); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.person = person == null ? null : person.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (type == null || type.isEmpty()) && (provider == null || provider.isEmpty()) + && (organization == null || organization.isEmpty()) && (person == null || person.isEmpty()) + ; + } + + } + + @Block() + public static class DiagnosisComponent extends BackboneElement { + /** + * Sequence of diagnosis. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Sequence of diagnosis", formalDefinition="Sequence of diagnosis." ) + protected IntegerType sequence; + + /** + * The diagnosis. + */ + @Child(name="diagnosis", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) + protected Coding diagnosis; + + private static final long serialVersionUID = -935927954L; + + public DiagnosisComponent() { + super(); + } + + public DiagnosisComponent(IntegerType sequence, Coding diagnosis) { + super(); + this.sequence = sequence; + this.diagnosis = diagnosis; + } + + /** + * @return {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (Sequence of diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DiagnosisComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return Sequence of diagnosis. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value Sequence of diagnosis. + */ + public DiagnosisComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #diagnosis} (The diagnosis.) + */ + public Coding getDiagnosis() { + if (this.diagnosis == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); + else if (Configuration.doAutoCreate()) + this.diagnosis = new Coding(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + return this.diagnosis != null && !this.diagnosis.isEmpty(); + } + + /** + * @param value {@link #diagnosis} (The diagnosis.) + */ + public DiagnosisComponent setDiagnosis(Coding value) { + this.diagnosis = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "Sequence of diagnosis.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + } + + public DiagnosisComponent copy() { + DiagnosisComponent dst = new DiagnosisComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + ; + } + + } + + @Block() + public static class CoverageComponent extends BackboneElement { + /** + * A service line item. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) + protected IntegerType sequence; + + /** + * The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + @Child(name="focal", type={BooleanType.class}, order=2, min=1, max=1) + @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against." ) + protected BooleanType focal; + + /** + * Reference to the program or plan identification, underwriter or payor. + */ + @Child(name="coverage", type={Coverage.class}, order=3, min=1, max=1) + @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) + protected Reference coverage; + + /** + * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) + */ + protected Coverage coverageTarget; + + /** + * The contract number of a business agrement which describes the terms and conditions. + */ + @Child(name="businessArrangement", type={StringType.class}, order=4, min=0, max=1) + @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agrement which describes the terms and conditions." ) + protected StringType businessArrangement; + + /** + * The relationship of the patient to the subscriber. + */ + @Child(name="relationship", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) + protected Coding relationship; + + /** + * A list of references from the Insurer to which these services pertain. + */ + @Child(name="preauthref", type={StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) + protected List preauthref; + + /** + * The Coverages adjudication details. + */ + @Child(name="claimResponse", type={ClaimResponse.class}, order=7, min=0, max=1) + @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) + protected Reference claimResponse; + + /** + * The actual object that is the target of the reference (The Coverages adjudication details.) + */ + protected ClaimResponse claimResponseTarget; + + /** + * The style (standard) and version of the original material which was converted into this resource. + */ + @Child(name="originalRuleset", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) + protected Coding originalRuleset; + + private static final long serialVersionUID = 450222500L; + + public CoverageComponent() { + super(); + } + + public CoverageComponent(IntegerType sequence, BooleanType focal, Reference coverage, Coding relationship) { + super(); + this.sequence = sequence; + this.focal = focal; + this.coverage = coverage; + this.relationship = relationship; + } + + /** + * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public CoverageComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line item. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line item. + */ + public CoverageComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public BooleanType getFocalElement() { + if (this.focal == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.focal"); + else if (Configuration.doAutoCreate()) + this.focal = new BooleanType(); + return this.focal; + } + + public boolean hasFocalElement() { + return this.focal != null && !this.focal.isEmpty(); + } + + public boolean hasFocal() { + return this.focal != null && !this.focal.isEmpty(); + } + + /** + * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value + */ + public CoverageComponent setFocalElement(BooleanType value) { + this.focal = value; + return this; + } + + /** + * @return The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public boolean getFocal() { + return this.focal == null ? false : this.focal.getValue(); + } + + /** + * @param value The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against. + */ + public CoverageComponent setFocal(boolean value) { + if (this.focal == null) + this.focal = new BooleanType(); + this.focal.setValue(value); + return this; + } + + /** + * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public Reference getCoverage() { + if (this.coverage == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverage = new Reference(); + return this.coverage; + } + + public boolean hasCoverage() { + return this.coverage != null && !this.coverage.isEmpty(); + } + + /** + * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverage(Reference value) { + this.coverage = value; + return this; + } + + /** + * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public Coverage getCoverageTarget() { + if (this.coverageTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.coverage"); + else if (Configuration.doAutoCreate()) + this.coverageTarget = new Coverage(); + return this.coverageTarget; + } + + /** + * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) + */ + public CoverageComponent setCoverageTarget(Coverage value) { + this.coverageTarget = value; + return this; + } + + /** + * @return {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public StringType getBusinessArrangementElement() { + if (this.businessArrangement == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); + else if (Configuration.doAutoCreate()) + this.businessArrangement = new StringType(); + return this.businessArrangement; + } + + public boolean hasBusinessArrangementElement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + public boolean hasBusinessArrangement() { + return this.businessArrangement != null && !this.businessArrangement.isEmpty(); + } + + /** + * @param value {@link #businessArrangement} (The contract number of a business agrement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value + */ + public CoverageComponent setBusinessArrangementElement(StringType value) { + this.businessArrangement = value; + return this; + } + + /** + * @return The contract number of a business agrement which describes the terms and conditions. + */ + public String getBusinessArrangement() { + return this.businessArrangement == null ? null : this.businessArrangement.getValue(); + } + + /** + * @param value The contract number of a business agrement which describes the terms and conditions. + */ + public CoverageComponent setBusinessArrangement(String value) { + if (Utilities.noString(value)) + this.businessArrangement = null; + else { + if (this.businessArrangement == null) + this.businessArrangement = new StringType(); + this.businessArrangement.setValue(value); + } + return this; + } + + /** + * @return {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public Coding getRelationship() { + if (this.relationship == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.relationship"); + else if (Configuration.doAutoCreate()) + this.relationship = new Coding(); + return this.relationship; + } + + public boolean hasRelationship() { + return this.relationship != null && !this.relationship.isEmpty(); + } + + /** + * @param value {@link #relationship} (The relationship of the patient to the subscriber.) + */ + public CoverageComponent setRelationship(Coding value) { + this.relationship = value; + return this; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public List getPreauthref() { + if (this.preauthref == null) + this.preauthref = new ArrayList(); + return this.preauthref; + } + + public boolean hasPreauthref() { + if (this.preauthref == null) + return false; + for (StringType item : this.preauthref) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + // syntactic sugar + public StringType addPreauthrefElement() {//2 + StringType t = new StringType(); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return t; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public CoverageComponent addPreauthref(String value) { //1 + StringType t = new StringType(); + t.setValue(value); + if (this.preauthref == null) + this.preauthref = new ArrayList(); + this.preauthref.add(t); + return this; + } + + /** + * @param value {@link #preauthref} (A list of references from the Insurer to which these services pertain.) + */ + public boolean hasPreauthref(String value) { + if (this.preauthref == null) + return false; + for (StringType v : this.preauthref) + if (v.equals(value)) // string + return true; + return false; + } + + /** + * @return {@link #claimResponse} (The Coverages adjudication details.) + */ + public Reference getClaimResponse() { + if (this.claimResponse == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponse = new Reference(); + return this.claimResponse; + } + + public boolean hasClaimResponse() { + return this.claimResponse != null && !this.claimResponse.isEmpty(); + } + + /** + * @param value {@link #claimResponse} (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponse(Reference value) { + this.claimResponse = value; + return this; + } + + /** + * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public ClaimResponse getClaimResponseTarget() { + if (this.claimResponseTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); + else if (Configuration.doAutoCreate()) + this.claimResponseTarget = new ClaimResponse(); + return this.claimResponseTarget; + } + + /** + * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) + */ + public CoverageComponent setClaimResponseTarget(ClaimResponse value) { + this.claimResponseTarget = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) + */ + public CoverageComponent setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication, that is the Coverage to which the claim is to be adjudicated against.", 0, java.lang.Integer.MAX_VALUE, focal)); + childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agrement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); + childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); + childrenList.add(new Property("preauthref", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preauthref)); + childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); + childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + } + + public CoverageComponent copy() { + CoverageComponent dst = new CoverageComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.focal = focal == null ? null : focal.copy(); + dst.coverage = coverage == null ? null : coverage.copy(); + dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); + dst.relationship = relationship == null ? null : relationship.copy(); + if (preauthref != null) { + dst.preauthref = new ArrayList(); + for (StringType i : preauthref) + dst.preauthref.add(i.copy()); + }; + dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) + && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) + && (relationship == null || relationship.isEmpty()) && (preauthref == null || preauthref.isEmpty()) + && (claimResponse == null || claimResponse.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) + ; + } + + } + + @Block() + public static class ItemsComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The practitioner who is responsible for the services rendered to the patient. + */ + @Child(name="provider", type={Practitioner.class}, order=3, min=0, max=1) + @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) + */ + protected Practitioner providerTarget; + + /** + * Diagnosis applicable for this service or product line. + */ + @Child(name="diagnosisLinkId", type={IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis Link", formalDefinition="Diagnosis applicable for this service or product line." ) + protected List diagnosisLinkId; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=5, min=1, max=1) + @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name="serviceDate", type={DateType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Date of Service", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateType serviceDate; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=7, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name="unitPrice", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=9, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=10, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=11, min=0, max=1) + @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=12, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Physical service site on the patient (limb, tooth, etc). + */ + @Child(name="bodySite", type={Coding.class}, order=13, min=0, max=1) + @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) + protected Coding bodySite; + + /** + * A region or surface of the site, eg. limb region or tooth surface(s). + */ + @Child(name="subsite", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) + protected List subsite; + + /** + * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. + */ + @Child(name="modifier", type={Coding.class}, order=15, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." ) + protected List modifier; + + /** + * Second tier of goods and services. + */ + @Child(name="detail", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." ) + protected List detail; + + private static final long serialVersionUID = -1140048455L; + + public ItemsComponent() { + super(); + } + + public ItemsComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public ItemsComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public ItemsComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public ItemsComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) + */ + public ItemsComponent setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public List getDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + return this.diagnosisLinkId; + } + + public boolean hasDiagnosisLinkId() { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType item : this.diagnosisLinkId) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + // syntactic sugar + public IntegerType addDiagnosisLinkIdElement() {//2 + IntegerType t = new IntegerType(); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return t; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public ItemsComponent addDiagnosisLinkId(int value) { //1 + IntegerType t = new IntegerType(); + t.setValue(value); + if (this.diagnosisLinkId == null) + this.diagnosisLinkId = new ArrayList(); + this.diagnosisLinkId.add(t); + return this; + } + + /** + * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) + */ + public boolean hasDiagnosisLinkId(int value) { + if (this.diagnosisLinkId == null) + return false; + for (IntegerType v : this.diagnosisLinkId) + if (v.equals(value)) // integer + return true; + return false; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public ItemsComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public DateType getServiceDateElement() { + if (this.serviceDate == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.serviceDate"); + else if (Configuration.doAutoCreate()) + this.serviceDate = new DateType(); + return this.serviceDate; + } + + public boolean hasServiceDateElement() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + public boolean hasServiceDate() { + return this.serviceDate != null && !this.serviceDate.isEmpty(); + } + + /** + * @param value {@link #serviceDate} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getServiceDate" gives direct access to the value + */ + public ItemsComponent setServiceDateElement(DateType value) { + this.serviceDate = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getServiceDate() { + return this.serviceDate == null ? null : this.serviceDate.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public ItemsComponent setServiceDate(Date value) { + if (value == null) + this.serviceDate = null; + else { + if (this.serviceDate == null) + this.serviceDate = new DateType(); + this.serviceDate.setValue(value); + } + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public ItemsComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public ItemsComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public ItemsComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public ItemsComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public ItemsComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public ItemsComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public ItemsComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public ItemsComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public Coding getBodySite() { + if (this.bodySite == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create ItemsComponent.bodySite"); + else if (Configuration.doAutoCreate()) + this.bodySite = new Coding(); + return this.bodySite; + } + + public boolean hasBodySite() { + return this.bodySite != null && !this.bodySite.isEmpty(); + } + + /** + * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) + */ + public ItemsComponent setBodySite(Coding value) { + this.bodySite = value; + return this; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + public List getSubsite() { + if (this.subsite == null) + this.subsite = new ArrayList(); + return this.subsite; + } + + public boolean hasSubsite() { + if (this.subsite == null) + return false; + for (Coding item : this.subsite) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subsite} (A region or surface of the site, eg. limb region or tooth surface(s).) + */ + // syntactic sugar + public Coding addSubsite() { //3 + Coding t = new Coding(); + if (this.subsite == null) + this.subsite = new ArrayList(); + this.subsite.add(t); + return t; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + public List getModifier() { + if (this.modifier == null) + this.modifier = new ArrayList(); + return this.modifier; + } + + public boolean hasModifier() { + if (this.modifier == null) + return false; + for (Coding item : this.modifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) + */ + // syntactic sugar + public Coding addModifier() { //3 + Coding t = new Coding(); + if (this.modifier == null) + this.modifier = new ArrayList(); + this.modifier.add(t); + return t; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + public List getDetail() { + if (this.detail == null) + this.detail = new ArrayList(); + return this.detail; + } + + public boolean hasDetail() { + if (this.detail == null) + return false; + for (DetailComponent item : this.detail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #detail} (Second tier of goods and services.) + */ + // syntactic sugar + public DetailComponent addDetail() { //3 + DetailComponent t = new DetailComponent(); + if (this.detail == null) + this.detail = new ArrayList(); + this.detail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("diagnosisLinkId", "integer", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("serviceDate", "date", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviceDate)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); + childrenList.add(new Property("subsite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subsite)); + childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); + childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); + } + + public ItemsComponent copy() { + ItemsComponent dst = new ItemsComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.provider = provider == null ? null : provider.copy(); + if (diagnosisLinkId != null) { + dst.diagnosisLinkId = new ArrayList(); + for (IntegerType i : diagnosisLinkId) + dst.diagnosisLinkId.add(i.copy()); + }; + dst.service = service == null ? null : service.copy(); + dst.serviceDate = serviceDate == null ? null : serviceDate.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + dst.bodySite = bodySite == null ? null : bodySite.copy(); + if (subsite != null) { + dst.subsite = new ArrayList(); + for (Coding i : subsite) + dst.subsite.add(i.copy()); + }; + if (modifier != null) { + dst.modifier = new ArrayList(); + for (Coding i : modifier) + dst.modifier.add(i.copy()); + }; + if (detail != null) { + dst.detail = new ArrayList(); + for (DetailComponent i : detail) + dst.detail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (provider == null || provider.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) + && (service == null || service.isEmpty()) && (serviceDate == null || serviceDate.isEmpty()) + && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (subsite == null || subsite.isEmpty()) + && (modifier == null || modifier.isEmpty()) && (detail == null || detail.isEmpty()); + } + + } + + @Block() + public static class DetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + /** + * Third tier of goods and services. + */ + @Child(name="subDetail", type={}, order=10, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) + protected List subDetail; + + private static final long serialVersionUID = -342502025L; + + public DetailComponent() { + super(); + } + + public DetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public DetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public DetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public DetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) + */ + public DetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public DetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) + */ + public DetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public DetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public DetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public DetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create DetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public DetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + public List getSubDetail() { + if (this.subDetail == null) + this.subDetail = new ArrayList(); + return this.subDetail; + } + + public boolean hasSubDetail() { + if (this.subDetail == null) + return false; + for (SubDetailComponent item : this.subDetail) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #subDetail} (Third tier of goods and services.) + */ + // syntactic sugar + public SubDetailComponent addSubDetail() { //3 + SubDetailComponent t = new SubDetailComponent(); + if (this.subDetail == null) + this.subDetail = new ArrayList(); + this.subDetail.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); + } + + public DetailComponent copy() { + DetailComponent dst = new DetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + if (subDetail != null) { + dst.subDetail = new ArrayList(); + for (SubDetailComponent i : subDetail) + dst.subDetail.add(i.copy()); + }; + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()) && (subDetail == null || subDetail.isEmpty()); + } + + } + + @Block() + public static class SubDetailComponent extends BackboneElement { + /** + * A service line number. + */ + @Child(name="sequence", type={IntegerType.class}, order=1, min=1, max=1) + @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) + protected IntegerType sequence; + + /** + * The type of product or service. + */ + @Child(name="type", type={Coding.class}, order=2, min=1, max=1) + @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) + protected Coding type; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="service", type={Coding.class}, order=3, min=1, max=1) + @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addtional service or product or charge." ) + protected Coding service; + + /** + * The number of repetitions of a service or product. + */ + @Child(name="quantity", type={Quantity.class}, order=4, min=0, max=1) + @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) + protected Quantity quantity; + + /** + * The fee for an addtional service or product or charge. + */ + @Child(name="unitPrice", type={Money.class}, order=5, min=0, max=1) + @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addtional service or product or charge." ) + protected Money unitPrice; + + /** + * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + @Child(name="factor", type={DecimalType.class}, order=6, min=0, max=1) + @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) + protected DecimalType factor; + + /** + * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + @Child(name="points", type={DecimalType.class}, order=7, min=0, max=1) + @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) + protected DecimalType points; + + /** + * The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + */ + @Child(name="net", type={Money.class}, order=8, min=0, max=1) + @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) + protected Money net; + + /** + * List of Unique Device Identifiers associated with this line item. + */ + @Child(name="udi", type={Coding.class}, order=9, min=0, max=1) + @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) + protected Coding udi; + + private static final long serialVersionUID = 122809194L; + + public SubDetailComponent() { + super(); + } + + public SubDetailComponent(IntegerType sequence, Coding type, Coding service) { + super(); + this.sequence = sequence; + this.type = type; + this.service = service; + } + + /** + * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public IntegerType getSequenceElement() { + if (this.sequence == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.sequence"); + else if (Configuration.doAutoCreate()) + this.sequence = new IntegerType(); + return this.sequence; + } + + public boolean hasSequenceElement() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + public boolean hasSequence() { + return this.sequence != null && !this.sequence.isEmpty(); + } + + /** + * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value + */ + public SubDetailComponent setSequenceElement(IntegerType value) { + this.sequence = value; + return this; + } + + /** + * @return A service line number. + */ + public int getSequence() { + return this.sequence == null ? null : this.sequence.getValue(); + } + + /** + * @param value A service line number. + */ + public SubDetailComponent setSequence(int value) { + if (this.sequence == null) + this.sequence = new IntegerType(); + this.sequence.setValue(value); + return this; + } + + /** + * @return {@link #type} (The type of product or service.) + */ + public Coding getType() { + if (this.type == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.type"); + else if (Configuration.doAutoCreate()) + this.type = new Coding(); + return this.type; + } + + public boolean hasType() { + return this.type != null && !this.type.isEmpty(); + } + + /** + * @param value {@link #type} (The type of product or service.) + */ + public SubDetailComponent setType(Coding value) { + this.type = value; + return this; + } + + /** + * @return {@link #service} (The fee for an addtional service or product or charge.) + */ + public Coding getService() { + if (this.service == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.service"); + else if (Configuration.doAutoCreate()) + this.service = new Coding(); + return this.service; + } + + public boolean hasService() { + return this.service != null && !this.service.isEmpty(); + } + + /** + * @param value {@link #service} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setService(Coding value) { + this.service = value; + return this; + } + + /** + * @return {@link #quantity} (The number of repetitions of a service or product.) + */ + public Quantity getQuantity() { + if (this.quantity == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.quantity"); + else if (Configuration.doAutoCreate()) + this.quantity = new Quantity(); + return this.quantity; + } + + public boolean hasQuantity() { + return this.quantity != null && !this.quantity.isEmpty(); + } + + /** + * @param value {@link #quantity} (The number of repetitions of a service or product.) + */ + public SubDetailComponent setQuantity(Quantity value) { + this.quantity = value; + return this; + } + + /** + * @return {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public Money getUnitPrice() { + if (this.unitPrice == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); + else if (Configuration.doAutoCreate()) + this.unitPrice = new Money(); + return this.unitPrice; + } + + public boolean hasUnitPrice() { + return this.unitPrice != null && !this.unitPrice.isEmpty(); + } + + /** + * @param value {@link #unitPrice} (The fee for an addtional service or product or charge.) + */ + public SubDetailComponent setUnitPrice(Money value) { + this.unitPrice = value; + return this; + } + + /** + * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public DecimalType getFactorElement() { + if (this.factor == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.factor"); + else if (Configuration.doAutoCreate()) + this.factor = new DecimalType(); + return this.factor; + } + + public boolean hasFactorElement() { + return this.factor != null && !this.factor.isEmpty(); + } + + public boolean hasFactor() { + return this.factor != null && !this.factor.isEmpty(); + } + + /** + * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value + */ + public SubDetailComponent setFactorElement(DecimalType value) { + this.factor = value; + return this; + } + + /** + * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public BigDecimal getFactor() { + return this.factor == null ? null : this.factor.getValue(); + } + + /** + * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + */ + public SubDetailComponent setFactor(BigDecimal value) { + if (value == null) + this.factor = null; + else { + if (this.factor == null) + this.factor = new DecimalType(); + this.factor.setValue(value); + } + return this; + } + + /** + * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public DecimalType getPointsElement() { + if (this.points == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.points"); + else if (Configuration.doAutoCreate()) + this.points = new DecimalType(); + return this.points; + } + + public boolean hasPointsElement() { + return this.points != null && !this.points.isEmpty(); + } + + public boolean hasPoints() { + return this.points != null && !this.points.isEmpty(); + } + + /** + * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value + */ + public SubDetailComponent setPointsElement(DecimalType value) { + this.points = value; + return this; + } + + /** + * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public BigDecimal getPoints() { + return this.points == null ? null : this.points.getValue(); + } + + /** + * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + */ + public SubDetailComponent setPoints(BigDecimal value) { + if (value == null) + this.points = null; + else { + if (this.points == null) + this.points = new DecimalType(); + this.points.setValue(value); + } + return this; + } + + /** + * @return {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public Money getNet() { + if (this.net == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.net"); + else if (Configuration.doAutoCreate()) + this.net = new Money(); + return this.net; + } + + public boolean hasNet() { + return this.net != null && !this.net.isEmpty(); + } + + /** + * @param value {@link #net} (The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) + */ + public SubDetailComponent setNet(Money value) { + this.net = value; + return this; + } + + /** + * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public Coding getUdi() { + if (this.udi == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create SubDetailComponent.udi"); + else if (Configuration.doAutoCreate()) + this.udi = new Coding(); + return this.udi; + } + + public boolean hasUdi() { + return this.udi != null && !this.udi.isEmpty(); + } + + /** + * @param value {@link #udi} (List of Unique Device Identifiers associated with this line item.) + */ + public SubDetailComponent setUdi(Coding value) { + this.udi = value; + return this; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("sequence", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); + childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); + childrenList.add(new Property("service", "Coding", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); + childrenList.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); + childrenList.add(new Property("unitPrice", "Money", "The fee for an addtional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); + childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); + childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); + childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addtional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); + childrenList.add(new Property("udi", "Coding", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); + } + + public SubDetailComponent copy() { + SubDetailComponent dst = new SubDetailComponent(); + copyValues(dst); + dst.sequence = sequence == null ? null : sequence.copy(); + dst.type = type == null ? null : type.copy(); + dst.service = service == null ? null : service.copy(); + dst.quantity = quantity == null ? null : quantity.copy(); + dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); + dst.factor = factor == null ? null : factor.copy(); + dst.points = points == null ? null : points.copy(); + dst.net = net == null ? null : net.copy(); + dst.udi = udi == null ? null : udi.copy(); + return dst; + } + + public boolean isEmpty() { + return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) + && (service == null || service.isEmpty()) && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) + && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) + && (udi == null || udi.isEmpty()); + } + + } + + /** + * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + */ + @Child(name="identifier", type={Identifier.class}, order=-1, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) + protected List identifier; + + /** + * The version of the specification on which this instance relies. + */ + @Child(name="ruleset", type={Coding.class}, order=0, min=0, max=1) + @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) + protected Coding ruleset; + + /** + * The version of the specification from which the original instance was created. + */ + @Child(name="originalRuleset", type={Coding.class}, order=1, min=0, max=1) + @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) + protected Coding originalRuleset; + + /** + * The date when the enclosed suite of services were performed or completed. + */ + @Child(name="created", type={DateTimeType.class}, order=2, min=0, max=1) + @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) + protected DateTimeType created; + + /** + * Insurer Identifier, typical BIN number (6 digit). + */ + @Child(name="target", type={Organization.class}, order=3, min=0, max=1) + @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) + protected Reference target; + + /** + * The actual object that is the target of the reference (Insurer Identifier, typical BIN number (6 digit).) + */ + protected Organization targetTarget; + + /** + * The provider which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="provider", type={Practitioner.class}, order=4, min=0, max=1) + @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference provider; + + /** + * The actual object that is the target of the reference (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Practitioner providerTarget; + + /** + * The organization which is responsible for the bill, claim pre-determination, pre-authorization. + */ + @Child(name="organization", type={Organization.class}, order=5, min=0, max=1) + @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) + protected Reference organization; + + /** + * The actual object that is the target of the reference (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + protected Organization organizationTarget; + + /** + * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + @Child(name="use", type={CodeType.class}, order=6, min=0, max=1) + @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) + protected Enumeration use; + + /** + * Immediate (STAT), best effort (NORMAL), deferred (DEFER). + */ + @Child(name="priority", type={Coding.class}, order=7, min=0, max=1) + @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) + protected Coding priority; + + /** + * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + */ + @Child(name="fundsReserve", type={Coding.class}, order=8, min=0, max=1) + @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) + protected Coding fundsReserve; + + /** + * Person who created the invoice/claim/pre-determination or pre-authorization. + */ + @Child(name="enterer", type={Practitioner.class}, order=9, min=0, max=1) + @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) + protected Reference enterer; + + /** + * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + protected Practitioner entererTarget; + + /** + * Facility where the services were provided. + */ + @Child(name="facility", type={Location.class}, order=10, min=0, max=1) + @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) + protected Reference facility; + + /** + * The actual object that is the target of the reference (Facility where the services were provided.) + */ + protected Location facilityTarget; + + /** + * Theparty to be reimbused for the services. + */ + @Child(name="payee", type={}, order=11, min=0, max=1) + @Description(shortDefinition="Payee", formalDefinition="Theparty to be reimbused for the services." ) + protected PayeeComponent payee; + + /** + * The referral resource which lists the date, practitioner, reason and other supporting information. + */ + @Child(name="referral", type={ReferralRequest.class}, order=12, min=0, max=1) + @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) + protected Reference referral; + + /** + * The actual object that is the target of the reference (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + protected ReferralRequest referralTarget; + + /** + * Ordered list of patient diagnosis for which care is sought. + */ + @Child(name="diagnosis", type={}, order=13, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) + protected List diagnosis; + + /** + * List of patient conditions for which care is sought. + */ + @Child(name="condition", type={Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="List of presenting Conditions", formalDefinition="List of patient conditions for which care is sought." ) + protected List condition; + + /** + * Patient Resource. + */ + @Child(name="patient", type={Patient.class}, order=15, min=1, max=1) + @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) + protected Reference patient; + + /** + * The actual object that is the target of the reference (Patient Resource.) + */ + protected Patient patientTarget; + + /** + * Financial instrument by which payment information for health care. + */ + @Child(name="coverage", type={}, order=16, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) + protected List coverage; + + /** + * Factors which may influence the applicability of coverage. + */ + @Child(name="exception", type={Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) + protected List exception; + + /** + * Name of school for over-aged dependants. + */ + @Child(name="school", type={StringType.class}, order=18, min=0, max=1) + @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) + protected StringType school; + + /** + * Date of an accident which these services are addessing. + */ + @Child(name="accident", type={DateType.class}, order=19, min=0, max=1) + @Description(shortDefinition="Accident Date", formalDefinition="Date of an accident which these services are addessing." ) + protected DateType accident; + + /** + * Type of accident: work, auto, etc. + */ + @Child(name="accidentType", type={Coding.class}, order=20, min=0, max=1) + @Description(shortDefinition="Accident Type", formalDefinition="Type of accident: work, auto, etc." ) + protected Coding accidentType; + + /** + * A list of intervention and exception codes which may influence the adjudication of the claim. + */ + @Child(name="interventionException", type={Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) + protected List interventionException; + + /** + * First tier of goods and services. + */ + @Child(name="item", type={}, order=22, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Goods and Servcies", formalDefinition="First tier of goods and services." ) + protected List item; + + /** + * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + */ + @Child(name="additionalMaterials", type={Coding.class}, order=23, min=0, max=Child.MAX_UNLIMITED) + @Description(shortDefinition="Additional materials, documents, etc.", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." ) + protected List additionalMaterials; + + private static final long serialVersionUID = 1113876752L; + + public VisionClaim() { + super(); + } + + public VisionClaim(Reference patient) { + super(); + this.patient = patient; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + public List getIdentifier() { + if (this.identifier == null) + this.identifier = new ArrayList(); + return this.identifier; + } + + public boolean hasIdentifier() { + if (this.identifier == null) + return false; + for (Identifier item : this.identifier) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #identifier} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) + */ + // syntactic sugar + public Identifier addIdentifier() { //3 + Identifier t = new Identifier(); + if (this.identifier == null) + this.identifier = new ArrayList(); + this.identifier.add(t); + return t; + } + + /** + * @return {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public Coding getRuleset() { + if (this.ruleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.ruleset"); + else if (Configuration.doAutoCreate()) + this.ruleset = new Coding(); + return this.ruleset; + } + + public boolean hasRuleset() { + return this.ruleset != null && !this.ruleset.isEmpty(); + } + + /** + * @param value {@link #ruleset} (The version of the specification on which this instance relies.) + */ + public VisionClaim setRuleset(Coding value) { + this.ruleset = value; + return this; + } + + /** + * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public Coding getOriginalRuleset() { + if (this.originalRuleset == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.originalRuleset"); + else if (Configuration.doAutoCreate()) + this.originalRuleset = new Coding(); + return this.originalRuleset; + } + + public boolean hasOriginalRuleset() { + return this.originalRuleset != null && !this.originalRuleset.isEmpty(); + } + + /** + * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) + */ + public VisionClaim setOriginalRuleset(Coding value) { + this.originalRuleset = value; + return this; + } + + /** + * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public DateTimeType getCreatedElement() { + if (this.created == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.created"); + else if (Configuration.doAutoCreate()) + this.created = new DateTimeType(); + return this.created; + } + + public boolean hasCreatedElement() { + return this.created != null && !this.created.isEmpty(); + } + + public boolean hasCreated() { + return this.created != null && !this.created.isEmpty(); + } + + /** + * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value + */ + public VisionClaim setCreatedElement(DateTimeType value) { + this.created = value; + return this; + } + + /** + * @return The date when the enclosed suite of services were performed or completed. + */ + public Date getCreated() { + return this.created == null ? null : this.created.getValue(); + } + + /** + * @param value The date when the enclosed suite of services were performed or completed. + */ + public VisionClaim setCreated(Date value) { + if (value == null) + this.created = null; + else { + if (this.created == null) + this.created = new DateTimeType(); + this.created.setValue(value); + } + return this; + } + + /** + * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public Reference getTarget() { + if (this.target == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.target"); + else if (Configuration.doAutoCreate()) + this.target = new Reference(); + return this.target; + } + + public boolean hasTarget() { + return this.target != null && !this.target.isEmpty(); + } + + /** + * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) + */ + public VisionClaim setTarget(Reference value) { + this.target = value; + return this; + } + + /** + * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) + */ + public Organization getTargetTarget() { + if (this.targetTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.target"); + else if (Configuration.doAutoCreate()) + this.targetTarget = new Organization(); + return this.targetTarget; + } + + /** + * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Insurer Identifier, typical BIN number (6 digit).) + */ + public VisionClaim setTargetTarget(Organization value) { + this.targetTarget = value; + return this; + } + + /** + * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getProvider() { + if (this.provider == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.provider"); + else if (Configuration.doAutoCreate()) + this.provider = new Reference(); + return this.provider; + } + + public boolean hasProvider() { + return this.provider != null && !this.provider.isEmpty(); + } + + /** + * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public VisionClaim setProvider(Reference value) { + this.provider = value; + return this; + } + + /** + * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Practitioner getProviderTarget() { + if (this.providerTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.provider"); + else if (Configuration.doAutoCreate()) + this.providerTarget = new Practitioner(); + return this.providerTarget; + } + + /** + * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public VisionClaim setProviderTarget(Practitioner value) { + this.providerTarget = value; + return this; + } + + /** + * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Reference getOrganization() { + if (this.organization == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organization = new Reference(); + return this.organization; + } + + public boolean hasOrganization() { + return this.organization != null && !this.organization.isEmpty(); + } + + /** + * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public VisionClaim setOrganization(Reference value) { + this.organization = value; + return this; + } + + /** + * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public Organization getOrganizationTarget() { + if (this.organizationTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.organization"); + else if (Configuration.doAutoCreate()) + this.organizationTarget = new Organization(); + return this.organizationTarget; + } + + /** + * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) + */ + public VisionClaim setOrganizationTarget(Organization value) { + this.organizationTarget = value; + return this; + } + + /** + * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public Enumeration getUseElement() { + if (this.use == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.use"); + else if (Configuration.doAutoCreate()) + this.use = new Enumeration(); + return this.use; + } + + public boolean hasUseElement() { + return this.use != null && !this.use.isEmpty(); + } + + public boolean hasUse() { + return this.use != null && !this.use.isEmpty(); + } + + /** + * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value + */ + public VisionClaim setUseElement(Enumeration value) { + this.use = value; + return this; + } + + /** + * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public UseLink getUse() { + return this.use == null ? null : this.use.getValue(); + } + + /** + * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + */ + public VisionClaim setUse(UseLink value) { + if (value == null) + this.use = null; + else { + if (this.use == null) + this.use = new Enumeration(UseLink.ENUM_FACTORY); + this.use.setValue(value); + } + return this; + } + + /** + * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public Coding getPriority() { + if (this.priority == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.priority"); + else if (Configuration.doAutoCreate()) + this.priority = new Coding(); + return this.priority; + } + + public boolean hasPriority() { + return this.priority != null && !this.priority.isEmpty(); + } + + /** + * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) + */ + public VisionClaim setPriority(Coding value) { + this.priority = value; + return this; + } + + /** + * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public Coding getFundsReserve() { + if (this.fundsReserve == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.fundsReserve"); + else if (Configuration.doAutoCreate()) + this.fundsReserve = new Coding(); + return this.fundsReserve; + } + + public boolean hasFundsReserve() { + return this.fundsReserve != null && !this.fundsReserve.isEmpty(); + } + + /** + * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) + */ + public VisionClaim setFundsReserve(Coding value) { + this.fundsReserve = value; + return this; + } + + /** + * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Reference getEnterer() { + if (this.enterer == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.enterer = new Reference(); + return this.enterer; + } + + public boolean hasEnterer() { + return this.enterer != null && !this.enterer.isEmpty(); + } + + /** + * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public VisionClaim setEnterer(Reference value) { + this.enterer = value; + return this; + } + + /** + * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public Practitioner getEntererTarget() { + if (this.entererTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.enterer"); + else if (Configuration.doAutoCreate()) + this.entererTarget = new Practitioner(); + return this.entererTarget; + } + + /** + * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.) + */ + public VisionClaim setEntererTarget(Practitioner value) { + this.entererTarget = value; + return this; + } + + /** + * @return {@link #facility} (Facility where the services were provided.) + */ + public Reference getFacility() { + if (this.facility == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facility = new Reference(); + return this.facility; + } + + public boolean hasFacility() { + return this.facility != null && !this.facility.isEmpty(); + } + + /** + * @param value {@link #facility} (Facility where the services were provided.) + */ + public VisionClaim setFacility(Reference value) { + this.facility = value; + return this; + } + + /** + * @return {@link #facility} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public Location getFacilityTarget() { + if (this.facilityTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.facility"); + else if (Configuration.doAutoCreate()) + this.facilityTarget = new Location(); + return this.facilityTarget; + } + + /** + * @param value {@link #facility} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.) + */ + public VisionClaim setFacilityTarget(Location value) { + this.facilityTarget = value; + return this; + } + + /** + * @return {@link #payee} (Theparty to be reimbused for the services.) + */ + public PayeeComponent getPayee() { + if (this.payee == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.payee"); + else if (Configuration.doAutoCreate()) + this.payee = new PayeeComponent(); + return this.payee; + } + + public boolean hasPayee() { + return this.payee != null && !this.payee.isEmpty(); + } + + /** + * @param value {@link #payee} (Theparty to be reimbused for the services.) + */ + public VisionClaim setPayee(PayeeComponent value) { + this.payee = value; + return this; + } + + /** + * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public Reference getReferral() { + if (this.referral == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referral = new Reference(); + return this.referral; + } + + public boolean hasReferral() { + return this.referral != null && !this.referral.isEmpty(); + } + + /** + * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public VisionClaim setReferral(Reference value) { + this.referral = value; + return this; + } + + /** + * @return {@link #referral} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public ReferralRequest getReferralTarget() { + if (this.referralTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.referral"); + else if (Configuration.doAutoCreate()) + this.referralTarget = new ReferralRequest(); + return this.referralTarget; + } + + /** + * @param value {@link #referral} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The referral resource which lists the date, practitioner, reason and other supporting information.) + */ + public VisionClaim setReferralTarget(ReferralRequest value) { + this.referralTarget = value; + return this; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + public List getDiagnosis() { + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + return this.diagnosis; + } + + public boolean hasDiagnosis() { + if (this.diagnosis == null) + return false; + for (DiagnosisComponent item : this.diagnosis) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) + */ + // syntactic sugar + public DiagnosisComponent addDiagnosis() { //3 + DiagnosisComponent t = new DiagnosisComponent(); + if (this.diagnosis == null) + this.diagnosis = new ArrayList(); + this.diagnosis.add(t); + return t; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + public List getCondition() { + if (this.condition == null) + this.condition = new ArrayList(); + return this.condition; + } + + public boolean hasCondition() { + if (this.condition == null) + return false; + for (Coding item : this.condition) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #condition} (List of patient conditions for which care is sought.) + */ + // syntactic sugar + public Coding addCondition() { //3 + Coding t = new Coding(); + if (this.condition == null) + this.condition = new ArrayList(); + this.condition.add(t); + return t; + } + + /** + * @return {@link #patient} (Patient Resource.) + */ + public Reference getPatient() { + if (this.patient == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.patient"); + else if (Configuration.doAutoCreate()) + this.patient = new Reference(); + return this.patient; + } + + public boolean hasPatient() { + return this.patient != null && !this.patient.isEmpty(); + } + + /** + * @param value {@link #patient} (Patient Resource.) + */ + public VisionClaim setPatient(Reference value) { + this.patient = value; + return this; + } + + /** + * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public Patient getPatientTarget() { + if (this.patientTarget == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.patient"); + else if (Configuration.doAutoCreate()) + this.patientTarget = new Patient(); + return this.patientTarget; + } + + /** + * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) + */ + public VisionClaim setPatientTarget(Patient value) { + this.patientTarget = value; + return this; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + public List getCoverage() { + if (this.coverage == null) + this.coverage = new ArrayList(); + return this.coverage; + } + + public boolean hasCoverage() { + if (this.coverage == null) + return false; + for (CoverageComponent item : this.coverage) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #coverage} (Financial instrument by which payment information for health care.) + */ + // syntactic sugar + public CoverageComponent addCoverage() { //3 + CoverageComponent t = new CoverageComponent(); + if (this.coverage == null) + this.coverage = new ArrayList(); + this.coverage.add(t); + return t; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + public List getException() { + if (this.exception == null) + this.exception = new ArrayList(); + return this.exception; + } + + public boolean hasException() { + if (this.exception == null) + return false; + for (Coding item : this.exception) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #exception} (Factors which may influence the applicability of coverage.) + */ + // syntactic sugar + public Coding addException() { //3 + Coding t = new Coding(); + if (this.exception == null) + this.exception = new ArrayList(); + this.exception.add(t); + return t; + } + + /** + * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public StringType getSchoolElement() { + if (this.school == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.school"); + else if (Configuration.doAutoCreate()) + this.school = new StringType(); + return this.school; + } + + public boolean hasSchoolElement() { + return this.school != null && !this.school.isEmpty(); + } + + public boolean hasSchool() { + return this.school != null && !this.school.isEmpty(); + } + + /** + * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value + */ + public VisionClaim setSchoolElement(StringType value) { + this.school = value; + return this; + } + + /** + * @return Name of school for over-aged dependants. + */ + public String getSchool() { + return this.school == null ? null : this.school.getValue(); + } + + /** + * @param value Name of school for over-aged dependants. + */ + public VisionClaim setSchool(String value) { + if (Utilities.noString(value)) + this.school = null; + else { + if (this.school == null) + this.school = new StringType(); + this.school.setValue(value); + } + return this; + } + + /** + * @return {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public DateType getAccidentElement() { + if (this.accident == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.accident"); + else if (Configuration.doAutoCreate()) + this.accident = new DateType(); + return this.accident; + } + + public boolean hasAccidentElement() { + return this.accident != null && !this.accident.isEmpty(); + } + + public boolean hasAccident() { + return this.accident != null && !this.accident.isEmpty(); + } + + /** + * @param value {@link #accident} (Date of an accident which these services are addessing.). This is the underlying object with id, value and extensions. The accessor "getAccident" gives direct access to the value + */ + public VisionClaim setAccidentElement(DateType value) { + this.accident = value; + return this; + } + + /** + * @return Date of an accident which these services are addessing. + */ + public Date getAccident() { + return this.accident == null ? null : this.accident.getValue(); + } + + /** + * @param value Date of an accident which these services are addessing. + */ + public VisionClaim setAccident(Date value) { + if (value == null) + this.accident = null; + else { + if (this.accident == null) + this.accident = new DateType(); + this.accident.setValue(value); + } + return this; + } + + /** + * @return {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public Coding getAccidentType() { + if (this.accidentType == null) + if (Configuration.errorOnAutoCreate()) + throw new Error("Attempt to auto-create VisionClaim.accidentType"); + else if (Configuration.doAutoCreate()) + this.accidentType = new Coding(); + return this.accidentType; + } + + public boolean hasAccidentType() { + return this.accidentType != null && !this.accidentType.isEmpty(); + } + + /** + * @param value {@link #accidentType} (Type of accident: work, auto, etc.) + */ + public VisionClaim setAccidentType(Coding value) { + this.accidentType = value; + return this; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + public List getInterventionException() { + if (this.interventionException == null) + this.interventionException = new ArrayList(); + return this.interventionException; + } + + public boolean hasInterventionException() { + if (this.interventionException == null) + return false; + for (Coding item : this.interventionException) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) + */ + // syntactic sugar + public Coding addInterventionException() { //3 + Coding t = new Coding(); + if (this.interventionException == null) + this.interventionException = new ArrayList(); + this.interventionException.add(t); + return t; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + public List getItem() { + if (this.item == null) + this.item = new ArrayList(); + return this.item; + } + + public boolean hasItem() { + if (this.item == null) + return false; + for (ItemsComponent item : this.item) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #item} (First tier of goods and services.) + */ + // syntactic sugar + public ItemsComponent addItem() { //3 + ItemsComponent t = new ItemsComponent(); + if (this.item == null) + this.item = new ArrayList(); + this.item.add(t); + return t; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + public List getAdditionalMaterials() { + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + return this.additionalMaterials; + } + + public boolean hasAdditionalMaterials() { + if (this.additionalMaterials == null) + return false; + for (Coding item : this.additionalMaterials) + if (!item.isEmpty()) + return true; + return false; + } + + /** + * @return {@link #additionalMaterials} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) + */ + // syntactic sugar + public Coding addAdditionalMaterials() { //3 + Coding t = new Coding(); + if (this.additionalMaterials == null) + this.additionalMaterials = new ArrayList(); + this.additionalMaterials.add(t); + return t; + } + + protected void listChildren(List childrenList) { + super.listChildren(childrenList); + childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier)); + childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset)); + childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); + childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); + childrenList.add(new Property("target", "Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target)); + childrenList.add(new Property("provider", "Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider)); + childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization)); + childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); + childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); + childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); + childrenList.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); + childrenList.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); + childrenList.add(new Property("payee", "", "Theparty to be reimbused for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); + childrenList.add(new Property("referral", "Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); + childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); + childrenList.add(new Property("condition", "Coding", "List of patient conditions for which care is sought.", 0, java.lang.Integer.MAX_VALUE, condition)); + childrenList.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); + childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); + childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); + childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); + childrenList.add(new Property("accident", "date", "Date of an accident which these services are addessing.", 0, java.lang.Integer.MAX_VALUE, accident)); + childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); + childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); + childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); + childrenList.add(new Property("additionalMaterials", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterials)); + } + + public VisionClaim copy() { + VisionClaim dst = new VisionClaim(); + copyValues(dst); + if (identifier != null) { + dst.identifier = new ArrayList(); + for (Identifier i : identifier) + dst.identifier.add(i.copy()); + }; + dst.ruleset = ruleset == null ? null : ruleset.copy(); + dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); + dst.created = created == null ? null : created.copy(); + dst.target = target == null ? null : target.copy(); + dst.provider = provider == null ? null : provider.copy(); + dst.organization = organization == null ? null : organization.copy(); + dst.use = use == null ? null : use.copy(); + dst.priority = priority == null ? null : priority.copy(); + dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); + dst.enterer = enterer == null ? null : enterer.copy(); + dst.facility = facility == null ? null : facility.copy(); + dst.payee = payee == null ? null : payee.copy(); + dst.referral = referral == null ? null : referral.copy(); + if (diagnosis != null) { + dst.diagnosis = new ArrayList(); + for (DiagnosisComponent i : diagnosis) + dst.diagnosis.add(i.copy()); + }; + if (condition != null) { + dst.condition = new ArrayList(); + for (Coding i : condition) + dst.condition.add(i.copy()); + }; + dst.patient = patient == null ? null : patient.copy(); + if (coverage != null) { + dst.coverage = new ArrayList(); + for (CoverageComponent i : coverage) + dst.coverage.add(i.copy()); + }; + if (exception != null) { + dst.exception = new ArrayList(); + for (Coding i : exception) + dst.exception.add(i.copy()); + }; + dst.school = school == null ? null : school.copy(); + dst.accident = accident == null ? null : accident.copy(); + dst.accidentType = accidentType == null ? null : accidentType.copy(); + if (interventionException != null) { + dst.interventionException = new ArrayList(); + for (Coding i : interventionException) + dst.interventionException.add(i.copy()); + }; + if (item != null) { + dst.item = new ArrayList(); + for (ItemsComponent i : item) + dst.item.add(i.copy()); + }; + if (additionalMaterials != null) { + dst.additionalMaterials = new ArrayList(); + for (Coding i : additionalMaterials) + dst.additionalMaterials.add(i.copy()); + }; + return dst; + } + + protected VisionClaim typedCopy() { + return copy(); + } + + public boolean isEmpty() { + return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) + && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) + && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) + && (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) && (fundsReserve == null || fundsReserve.isEmpty()) + && (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) && (payee == null || payee.isEmpty()) + && (referral == null || referral.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) + && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) + && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (accident == null || accident.isEmpty()) + && (accidentType == null || accidentType.isEmpty()) && (interventionException == null || interventionException.isEmpty()) + && (item == null || item.isEmpty()) && (additionalMaterials == null || additionalMaterials.isEmpty()) + ; + } + + @Override + public ResourceType getResourceType() { + return ResourceType.VisionClaim; + } + + @SearchParamDefinition(name="patient", path="VisionClaim.patient", description="Patient", type="reference" ) + public static final String SP_PATIENT = "patient"; + @SearchParamDefinition(name="priority", path="VisionClaim.priority", description="Processing priority requested", type="token" ) + public static final String SP_PRIORITY = "priority"; + @SearchParamDefinition(name="use", path="VisionClaim.use", description="The kind of financial resource", type="token" ) + public static final String SP_USE = "use"; + @SearchParamDefinition(name="identifier", path="VisionClaim.identifier", description="The primary identifier of the financial resource", type="token" ) + public static final String SP_IDENTIFIER = "identifier"; + +} +